PDA

View Full Version : displaying a color spectrum


Tom Paine
11-29-2007, 09:01 AM
Don't know if this is of any interest but I thought I'd share it.
Sometimes it can be quite nice to be able to display a color spectrum (ie a rainbow effect) maybe to color a background or as a fancy border round a control . It's quite difficult to smoothly transition through the different colors of the spectrum using the RGB system. It's much easier if you use the HSV color system. I've produced a conversion utility to convert from HSV to RGB and used it to display a scrolling spectrum as a demo. Feel free to rip out the conversion code and use it.[br]1196326839_438_FT0_rainbow.zip

Mike Halliday
11-29-2007, 11:11 AM
Very nice routine.

I can see a use in a paint package or in a sprite designer for colour selection

Well done and thanks for sharing.

kornalius
11-29-2007, 03:17 PM
Very nice Tom, thank you for sharing with us! Keep them coming!