Simplest way to draw a HSV colour wheel?

Hi all,

Has anyone who’s got some solid juce Graphics class drawing experience got any ideas as to how to draw a HSV style colourwheel most efficient ?

I need to draw heaps of these on collapsible panes, so performance is an issue, and antialiasing would be cool.

I can’t use prerendered bitmaps with transforms on them, as i need the Hue part of the wheel (eg the spectral band that goes round the wheel) dynamically calculated from a custom spectral distribution, and the triangle needs to rotate.

here’s a typical HSV wheel:

ideas and tips in pseudo code or other thoughts appreciated :slight_smile:


For things like that where you need to calculate each pixel individually, the best way is probably to get an image, call lockPixelDataReadWrite to get a pointer to raw image data, and just set the pixels you need…

To get nice anti-aliased edges without having to manually calculate them, you could use your image as an ImageBrush to fill a path in the shape of your triangle and circle.

1 Like


the imagebrush idea with a path is probably the best way to go,
thanks, i’ll look into it :slight_smile: