当前位置: 首页>>代码示例>>PHP>>正文


PHP Color::verbose方法代码示例

本文整理汇总了PHP中Color::verbose方法的典型用法代码示例。如果您正苦于以下问题:PHP Color::verbose方法的具体用法?PHP Color::verbose怎么用?PHP Color::verbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Color的用法示例。


在下文中一共展示了Color::verbose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Color

<?php

require_once 'Color.class.php';
//print( Color::doc() );
Color::$verbose = True;
$red = new Color(array('red' => 0xff, 'green' => 0, 'blue' => 0));
$green = new Color(array('rgb' => 255 << 8));
$blue = new Color(array('red' => 0, 'green' => 0, 'blue' => 0xff));
$yellow = $red->add($green);
$cyan = $green->add($blue);
$magenta = $blue->add($red);
$white = $red->add($green)->add($blue);
print $red . PHP_EOL;
print $green . PHP_EOL;
print $blue . PHP_EOL;
print $yellow . PHP_EOL;
print $cyan . PHP_EOL;
print $magenta . PHP_EOL;
print $white . PHP_EOL;
Color::$verbose = False;
$black = $white->sub($red)->sub($green)->sub($blue);
print 'Black: ' . $black . PHP_EOL;
Color::$verbose = True;
$darkgrey = new Color(array('rgb' => (10 << 16) + (10 << 8) + 10));
print 'darkgrey: ' . $darkgrey . PHP_EOL;
$lightgrey = $darkgrey->mult(22.5);
print 'lightgrey: ' . $lightgrey . PHP_EOL;
$random = new Color(array('red' => 12.3, 'green' => 31.2, 'blue' => 23.1));
print 'random: ' . $random . PHP_EOL;
开发者ID:yderosie,项目名称:piscine_php,代码行数:29,代码来源:main_00.php

示例2: Vertex

<?php

/* ************************************************************************** */
/*                                                                            */
/*                 main_01.php for J06                                        */
/*                 Created on : Mon Mar 31 17:37:41 2014                      */
/*                 Made by : David "Thor" GIRON <thor@42.fr>                  */
/*                                                                            */
/* ************************************************************************** */
require_once 'Color.class.php';
require_once 'Vertex.class.php';
Color::$verbose = False;
print Vertex::doc();
Vertex::$verbose = True;
$vtxO = new Vertex(array('x' => 0.0, 'y' => 0.0, 'z' => 0.0));
print $vtxO . PHP_EOL;
$red = new Color(array('red' => 255, 'green' => 0, 'blue' => 0));
$green = new Color(array('red' => 0, 'green' => 255, 'blue' => 0));
$blue = new Color(array('red' => 0, 'green' => 0, 'blue' => 255));
$unitX = new Vertex(array('x' => 1.0, 'y' => 0.0, 'z' => 0.0, 'color' => $green));
$unitY = new Vertex(array('x' => 0.0, 'y' => 1.0, 'z' => 0.0, 'color' => $red));
$unitZ = new Vertex(array('x' => 0.0, 'y' => 0.0, 'z' => 1.0, 'color' => $blue));
print $unitX . PHP_EOL;
print $unitY . PHP_EOL;
print $unitZ . PHP_EOL;
Vertex::$verbose = False;
$sqrA = new Vertex(array('x' => 0.0, 'y' => 0.0, 'z' => 0.0));
$sqrB = new Vertex(array('x' => 4.2, 'y' => 0.0, 'z' => 0.0));
$sqrC = new Vertex(array('x' => 4.2, 'y' => 4.2, 'z' => 0.0));
$sqrD = new Vertex(array('x' => 0.0, 'y' => 4.2, 'z' => 0.0));
print $sqrA . PHP_EOL;
开发者ID:samiateber,项目名称:42,代码行数:31,代码来源:main_01.php


注:本文中的Color::verbose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。