</tr>
		</table>
	</div><!-- .form-container -->
<?php 
if (isset($_GET['mode1']) && isset($_GET['mode2']) || $_GET['color'] == 'Gradient') {
    ?>
		<h3>Color gradient</h3>
		<div class="color-results">
			<div class="variations">
<?php 
    $del_h = ($h2 - $h1) / ($steps + 1);
    $del_s = ($s2 - $s1) / ($steps + 1);
    $del_l = ($l2 - $l1) / ($steps + 1);
    rgb_sample($r1, $g1, $b1, 'First color');
    for ($i = 1; $i <= $steps; $i++) {
        hsl_sample($h1 + round($del_h * $i), $s1 + round($del_s * $i), $l1 + round($del_l * $i), 'Gradient');
        echo chr(10);
    }
    rgb_sample($r2, $g2, $b2, 'Second color');
    ?>
			</div>
		</div>
		
<?php 
}
?>


<?php 
include '../inc/_wrap_after.php';
include '../inc/_sidebar.php';
Example #2
0
$rand = rgb2hex($rand_rgb[0], $rand_rgb[1], $rand_rgb[2]);
$bgrand = readable_color($rand_rgb[0], $rand_rgb[1], $rand_rgb[2]);
?>

	<h2>Convert HSL to RGB</h2>
	<p>You can convert color from HSL to RGB and from HSL to Hex or just click <?php 
echo random_link_hsl();
?>
.</p>

<?php 
if (isset($_GET['h']) && isset($_GET['s']) && isset($_GET['l'])) {
    $h = $_GET['h'];
    $s = $_GET['s'];
    $l = $_GET['l'];
    hsl_sample($h, $s, $l, 'Basic color');
}
?>

<script type="text/javascript">
jQuery(function($){
	$('.form-container').wrap('<fo'+'rm name="color" method="get" action="<?php 
echo basename(__FILE__);
?>
"></fo'+'rm>');
});
</script>
		
	<div class="form-container">

		<table>
Example #3
0
echo 'background-color:' . $hex . '; color:' . $color . ';';
?>
">


<?php 
rgb_sample($r, $g, $b, 'Basic color');
?>
		<h3>Complementary colors:</h3>
					
<?php 
hsl_sample($h + 30, $s, $l, 'Analogous harmony (H+30)');
hsl_sample($h - 30, $s, $l, 'Analogous harmony (H-30)');
hsl_sample($h + 120, $s, $l, 'Triadic harmony (H+120)');
hsl_sample($h - 120, $s, $l, 'Triadic harmony (H-120)');
hsl_sample($h + 150, $s, $l, 'Split complements harmony (H+150)');
hsl_sample($h - 150, $s, $l, 'Split complements harmony (H-150)');
hsl_sample($h + 180, $s, $l, 'Complement harmony (H+180)');
hsl_sample($h, $s + 30, $l, 'Monochromatic harmony (S+30)');
hsl_sample($h, $s - 30, $l, 'Monochromatic harmony (S-30)');
hsl_sample($h, $s, $l + 10, 'Monochromatic harmony (L+10)');
hsl_sample($h, $s, $l - 10, 'Monochromatic harmony (L-10)');
?>

	
	</div>
	
<?php 
include '../inc/_wrap_after.php';
include '../inc/_sidebar.php';
include '../inc/_footer.php';
Example #4
0
for ($i = 0; $i < 36; $i++) {
    hsl_sample($h + $i * 10, $s, $l);
}
?>
			</div>
			
			<h3>Saturation variations:</h3>
			<div class="saturation-variations">
<?php 
for ($i = 10; $i <= 100; $i = $i + 10) {
    hsl_sample($h, $i, $l);
}
?>
			</div>
			
			<h3>Lightness variations:</h3>
			<div class="lightness-variations">
<?php 
for ($i = 10; $i <= 90; $i = $i + 10) {
    hsl_sample($h, $s, $i);
}
?>
			</div>
			
		</div>
	</div>
	
<?php 
include '../inc/_wrap_after.php';
include '../inc/_sidebar.php';
include '../inc/_footer.php';