I'm using the Juce Framework that has a setColour
method like so:
g.setColour (Colour (0xff2a2620));
I instead would like to write something like more readable like:
g.setColour (Colour (lovelyBrown));
, 'mapping' 0xff2a2620
to 'lovelyBrown'.
The method's prototype is:
explicit Colour (uint32 argb) noexcept;
where uint32
is:
/** A platform-independent 32-bit unsigned integer type. */
typedef unsigned int uint32;
Juce has nice readable colour names already such as:
const Colour Colours::tomato (0xffff6347);
, using a method to find the colour given a name:
static JUCE_API Colour findColourForName (const String& colourName,
const Colour& defaultColour);
However, I don't want to modify or subclass their Colours class. I am wondering if there is a simpler way of 'mapping' 0xff2a2620
to 'lovelyBrown'?