GUI Color Selector?

How can I make a GUI Color selector? Like this:

[14967-color+selector.png|14967]

I know it can be done because I’ve seen other people do it. Do you know how I can?

Make a texture in this color, look up the math for it (looks like in your graphic, blue and green are corners, and red is on the edge), and just use the mouse coordinate to calculate the appropriate color.

You don’t need to look up the color from the texture for this kind of gradient, you only need the mathematical representation and calculate the color from x and y coordinte of mouse inside rectangle.