Sign in to follow this  

[DX9] Color Spectrum

This topic is 3669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been working on trying to get a color spectrum (such as Photoshop's or MSPaint) for some time now and I just can not get it to work. Basically I am having a problem drawing the correct colors. Does anyone know a tutorial that would help put me back on the right path?

Share this post


Link to post
Share on other sites
Are you talking about this thing? That's the Color Dialog Box, part of the Common Dialog Library in with Windows API. This MSDN page talks about it and how the HSL values are laid out on the rectangle.

If you need to draw it in D3D, probably the easiest way to do it is to draw a quad with the appropriate H & S values set as texture coordinates for the corners of the quad. Then you can pass them through the vertex shader so they're interpolated, and for each pixel perform the HSL to RGB conversion.

Share this post


Link to post
Share on other sites
Sign in to follow this