Login   Register  
PHP Classes
elePHPant
Icontem

File: test_color2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Julien PACHET  >  Color  >  test_color2.php  >  Download  
File: test_color2.php
Role: Example script
Content type: text/plain
Description: Example of Bright / dark color
Class: Color
Transform color tones using different formats
Author: By
Last change:
Date: 10 years ago
Size: 505 bytes
 

Contents

Class file image Download
<?
    
require_once("class_color.inc.php");

    
$c=new color();
    
$c->set_from_rgb(224,200,226);
    echo 
"<table>\n";
    echo 
"<tr>\n";
    for (
$i=0;$i>-1;$i-=0.05) {
        
$c2=new color();
        
$c2->set_from_rgb(224,200,226);
        
$temp=$c2->get_hsl();
        echo 
"avant:".$temp[0]." ".$temp[1]." ".$temp[2];
        
$c2->mod_l_hsl($i);
        
$temp=$c2->get_hsl();
                echo 
"apres:".$temp[0]." ".$temp[1]." ".$temp[2]."<br>";
        echo 
"<td bgcolor=#".$c2->get_rgbhex().">&nbsp;</td>\n";
    }
    echo 
"</tr>\n";
    echo 
"</table>\n";
?>