P
ROTOTYPE
I'm Not Only The Prototype, I'm Also A Member.
home
▪
stats
▪
search
▪
linkback
▪
about
▪
FAQ
| user: guest,
login
,
register
Color
:
HSBtoRGB()
author:
Prometh
[+]
,
Submitted: 12.02.03 1p
Color.HSBtoRGB = function(h,s,v) { var r,g,b; var h = Math.round(h); var s = Math.round(s*255/100); var v = Math.round(v*255/100); if(s == 0) { r = g = b = v; } else { var t1 = v; var t2 = (255-s)*v/255; var t3 = (t1-t2)*(h%60)/60; if(h==360) h = 0; if(h<60) {r=t1; b=t2; g=t2+t3} else if(h<120) {g=t1; b=t2; r=t1-t3} else if(h<180) {g=t1; r=t2; b=t2+t3} else if(h<240) {b=t1; r=t2; g=t1-t3} else if(h<300) {b=t1; g=t2; r=t2+t3} else if(h<360) {r=t1; g=t2; b=t1-t3} else {r=0; g=0; b=0} } return {r:r, g:g, b:b}; }
usage
// This is another clensed Luzifer Altenberg script. He gets the most credit // You can compare these values to those produced in the Photoshop Color Picker h = 255; s = 125; b = 75; rgb = HSBtoRGB(h,s,b); trace(rgb.r); trace(rgb.g); trace(rgb.b);
Add Comment
[+]
›opyleft 2001-2010. Layer51 is: Jaime Prado.
@