This is an ‘enhanced’ ColourSelector. It is a component which contains a standard JUCE ColourSelector component and a new ‘ColourPalette’ component.
The two components are aligned depending on the main component’s parameters:
topBottomSplit : boolean value; if true, the palette will be placed above the selector, else it will be positioned to the left. [default:TRUE]
paletteProportion: float; this determines how much of the component is taken up by the palette [default:0.2f]
you don’t have to worry about the dimensions of the palette itself; if you set it to be 20wide and 3high and yet you set it with a horizontal split (down the side) it will automatically rotate the palette by itself so it fits more sensibly.
here are some examples of how it looks:
example1: 300x350, 10x3 palette, top/bottom split, 0.2 palette proportion
example2: 300x280, 10x1 palette, left/right split, 0.1 palette proportion
download the .ZIP archive; this was created in VC++express; there is a test dialog application code file included, so if you create a new blank project and simply add all the files in this zip it should compile with a test dialog.
there are still plenty of ways this could be improved, but hopefully this is of some use to someone? make sure you #include “ColourSelectorWithPalette.h” to use it in a project.
credit to haydxn, jtxx000 and jules