View Single Post
Old 12th May 2003, 11:29   #88
Montana
Major Dude
 
Montana's Avatar
 
Join Date: Dec 2001
Location: Södertälje, Sweden
Posts: 1,058
Send a message via ICQ to Montana Send a message via AIM to Montana Send a message via Yahoo to Montana
hsv to rgb, fast version

init: tpi=acos(-1)*2; pit=tpi/6; tpit=pit*2;
pixel:
sat2=sat*0.5; hue2=hue*tpi;
red=abs(sin(hue2))*sat2+lum;
green=abs(sin(hue2+pit))*sat2+lum;
blue=abs(sin(hue2+tpit))*sat2+lum;

batman
Montana is offline   Reply With Quote