How to specify text color
-
I have a project which uses a certain shade of gold for text labels, which is #FFB7AA5B
I created panels to display db meter scales, but cannot figure out how to specify a color other than just Colours.gold//Panel 1 const var dBScalePanel1 = Content.addPanel("dBScale1", 20, 160); dBScalePanel1.set("width", 30); dBScalePanel1.set("height", panelHeight); dBScalePanel1.setPaintRoutine(function(g) { g.setColour(Colours.gold); g.setFont("Roboto", 10); var usableHeight = panelHeight - paddingTop - paddingBottom; for (i = 0; i < scaleValues.length; i++) { var y = (scaleValues[i] / -60.0) * usableHeight + paddingTop; g.drawAlignedText(scaleValues[i] + " dB", [0, y - 6, 40, 12], "left"); } });
-
The docs on
Colours
are pretty comprehensive: -
"#FFB7AA5B"
is a hex representation of a colour with the#AARRGGBB
format. You're almost there, you just need to turn that into an actual number with the hex format:const var RED = 0xFFFF0000; const var GREEN = 0xFF00FF00; // same as #FF00FF00 const var TRANSPARENT = 0; // shortcut for 0x00000000