예제 #1
0
	height: 7em;
	float: left;
}
</style>

<h1>Trying to map the correct human colour names to hsl-hue values.</h1>
<p>In order to set the correct colour names, saturation is set to 100%, and lightness to 50%. So <code>hsl(120,100%,50%)</code> might result in something like <q>A highly saturated green</q>. I <em>guess</em> this is a good setting for analyzing colours, if you know a better setting, let me know. Colours like <em>brown</em> will not appear with this setting — brown might be described like <q>an unsaturated, dark red</q> instead.</p>

<p>In this next table you'll see the value of the hue, and the human name behind it. If you know a better layout for such a table, please let me know. </p>
<p>We're looking for the correct names here <em>and</em> for the correct boundaries: does green really end at 163? If you know of a scientific approach, please let me know.</p>
<?php 
$h1 = rand(0, 360);
$s1 = rand(0, 100);
$l1 = rand(0, 100);
$colour1 = hueName($h1);
$saturation1 = saturationName($s1);
$lightness1 = lightnessName($l1);
$i = 0;
while ($i < 360) {
    echo '<div style="background: hsl(' . $i . ', 100%, 50%)">' . $i . ' = ' . hueName($i) . '</div>';
    $i++;
}
?>







	height: 7em;
	float: left;
}
</style>

<h1>Trying to map the correct human lightness names to hsl-lightness values</h1>
<p>In order to set the correct lightness names, colour is set to 120 (green), and saturation to 100%. So <code>hsl(120,100%,15%)</code> might result in something like <q>A rather saturated, very dark green</q>. I <em>guess</em> this is a good setting for analyzing lightness, if you know a better setting, let me know. </p>

<p>In this next table you'll see the value of the lightness, and the human name behind it. If you know a better layout for such a table, please let me know. </p>
<p>We're looking for the correct names here <em>and</em> for the correct boundaries: does <em>almost black</em> really end at 9? If you know of a scientific approach, please let me know.</p>
<?php 
$h1 = rand(0, 360);
$s1 = rand(0, 100);
$l1 = rand(0, 100);
$colour1 = hueName($h1);
$saturation1 = saturationName($s1);
$lightness1 = lightnessName($l1);
$i = 1;
while ($i < 101) {
    echo '<div style="background: hsl(120, 100%, ' . $i . '%)">' . $i . ' = ' . lightnessName($i) . '</div>';
    $i++;
}
?>