Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- include 'misc.inc';
- for ($temp = -5; $temp < 5; $temp += 0.5)
- {
- $red = atan($temp) / 3.141593 + 0.5;
- $blue = 1 - $red;
- $green = $red*0.3 + $blue*0.7;
- $red = $red*255;
- $green = $green*255;
- $blue = $blue*255;
- $colorcode = RGBtoHtmlColor($red, $green, $blue);
- printf("temperature %+.02f = RGB %03.0f, %03.0f, %03.0f (#%s)\n", $temp, $red, $green, $blue, $colorcode);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement