Login   Register  
PHP Classes
elePHPant
Icontem

File: test/test_MyColors.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Lokesh  >  myColors  >  test/test_MyColors.php  >  Download  
File: test/test_MyColors.php
Role: Example script
Content type: text/plain
Description: Class source
Class: myColors
Analyze and convert color values
Author: By
Last change:
Date: 2012-07-22 12:49
Size: 2,178 bytes
 

Contents

Class file image Download
<?php

    
require_once '../core/myColors.class.php';
?>

<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset=utf-8 />
        <title>myColors - code your own formula</title>
        <link href="../doc/src/styles.css" type="text/css" rel="stylesheet" >
    </head>
    <body>
        <div id="title">
            <img src="../doc/src/myc.png"/><font size="0.5em">v1.0</font>
        </div>
        <!-- content -->
        <div id="content">
            <div id="content">
                <h1>Live Demo</h1>
                <h3>input color value. example (#2f8cab, #45a, rgb(12,34,126), hsl(220,45,89), hsv(110,14,72), name(red))</h3>
                <div class="body">
                    <form method="get" action="test_MyColors.php">
                        <input type="text" name="color" />
                        <input type="submit" value="  enter  " name="submit"/>
                    </form>
                    <?php
                    $formula 
'red';
                    
$degree 15;
                    
$total 10;
                    
$colors_info FALSE;
                    
$colorize = new myColors($_GET['color'], $colors_info);

                    
$rr $colorize -> discover($formula$total$degree);
                    echo 
"<div class=\"layout\"><pre>";
                    
print_r($rr);
                    echo 
"</pre></div>";
                    
$info $colorize -> displayInfo();
                    echo 
'<h2>#' $info[0]['hex color'] . ' (' $info[0]['info']['color name'] . ') ' '</h2></br></br></br>';

                    foreach (
$rr as $r)
                    {
                        echo 
"<span style=\"padding:25px 45px;max-width:40px;background-color:#" $r "\"> <span style=\"color:#$r\">-</span> </span>";
                    }

                    
/**
                     *    if $color_values set to TRUE use this loop instead of top loop
                     foreach ($rr as $r)
                     {
                     foreach ($r as $col)
                     echo "<span style=\"padding:25px 45px;max-width:40px;background-color:#" . $col.
                     "\"> <span //style=\"color:#$col\">-</span> </span>";
                     }

                     */
                    
?>

                    <br/>
                    <br/>
                    <br/>
                    <div id="footer">
                        myColors Copyright 2012
                        <br>
                        Project vylson silwr
                    </div>
    </body>
</html>