Sign in to follow this  
simotix

[DX9] Color Spectrum

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this