本文整理汇总了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;
示例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;