Skip to content

Commit 18fbbb3

Browse files
committed
Store all colour as bgra for free conversion between nvgColor and juce::Colour
1 parent ebe6430 commit 18fbbb3

28 files changed

Lines changed: 80 additions & 203 deletions

Source/Canvas.cpp

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ class ObjectsResizer final : public Component
168168
{
169169
// draw background and outline
170170
auto const b = getBounds().reduced(tabMargin);
171-
auto iCol = cnv->selectedOutlineCol;
171+
auto iCol = nvgColour(PlugDataColours::objectSelectedOutlineColour);
172172

173173
iCol.a = 5; // Make the inner colour semi-transparent
174-
nvgDrawRoundedRect(nvg, b.getX(), b.getY(), b.getWidth(), b.getHeight(), iCol, cnv->selectedOutlineCol, Corners::objectCornerRadius);
174+
nvgDrawRoundedRect(nvg, b.getX(), b.getY(), b.getWidth(), b.getHeight(), iCol, nvgColour(PlugDataColours::objectSelectedOutlineColour), Corners::objectCornerRadius);
175175

176176
// Draw handles at edge
177177
auto getCorners = [this] {
@@ -195,7 +195,7 @@ class ObjectsResizer final : public Component
195195

196196
nvgBeginPath(nvg);
197197
nvgRect(nvg, 0, 0, 9, 9);
198-
nvgFillPaint(nvg, nvgImageAlphaPattern(nvg, 0, 0, 9, 9, 0, resizeHandleImage.getImageId(), cnv->selectedOutlineCol));
198+
nvgFillPaint(nvg, nvgImageAlphaPattern(nvg, 0, 0, 9, 9, 0, resizeHandleImage.getImageId(), nvgColour(PlugDataColours::objectSelectedOutlineColour)));
199199
nvgFill(nvg);
200200
angle -= 90;
201201
}
@@ -424,57 +424,6 @@ void Canvas::changeListenerCallback(ChangeBroadcaster* c)
424424

425425
void Canvas::lookAndFeelChanged()
426426
{
427-
// Canvas colours
428-
canvasBackgroundColJuce = PlugDataColours::canvasBackgroundColour;
429-
canvasBackgroundCol = nvgColour(canvasBackgroundColJuce);
430-
canvasMarkingsColJuce = PlugDataColours::canvasDotsColour.interpolatedWith(canvasBackgroundColJuce, 0.2f);
431-
canvasMarkingsCol = nvgColour(canvasMarkingsColJuce);
432-
canvasTextColJuce = PlugDataColours::canvasTextColour;
433-
434-
// Object colours
435-
objectOutlineCol = nvgColour(PlugDataColours::objectOutlineColour);
436-
outlineCol = nvgColour(PlugDataColours::outlineColour);
437-
textObjectBackgroundCol = nvgColour(PlugDataColours::textObjectBackgroundColour);
438-
ioletLockedCol = nvgColour(canvasBackgroundColJuce.contrasting(0.5f));
439-
440-
commentTextCol = nvgColour(PlugDataColours::commentTextColour);
441-
442-
guiObjectInternalOutlineColJuce = PlugDataColours::guiObjectInternalOutlineColour;
443-
guiObjectInternalOutlineCol = nvgColour(guiObjectInternalOutlineColJuce);
444-
guiObjectBackgroundColJuce = PlugDataColours::guiObjectBackgroundColour;
445-
guiObjectBackgroundCol = nvgColour(guiObjectBackgroundColJuce);
446-
447-
auto const selectedColJuce = PlugDataColours::objectSelectedOutlineColour;
448-
selectedOutlineCol = nvgColour(selectedColJuce);
449-
transparentObjectBackgroundCol = nvgColour(canvasBackgroundColJuce.contrasting(0.35f).withAlpha(0.1f));
450-
indexTextCol = nvgColour(selectedColJuce.contrasting());
451-
452-
graphAreaCol = nvgColour(PlugDataColours::graphAreaColour);
453-
454-
// Lasso colours
455-
lassoCol = nvgColour(selectedColJuce.withAlpha(0.075f));
456-
lassoOutlineCol = nvgColour(canvasBackgroundColJuce.interpolatedWith(selectedColJuce, 0.65f));
457-
458-
// Presentation mode colors
459-
auto const presentationBackgroundColJuce = PlugDataColours::presentationBackgroundColour;
460-
presentationBackgroundCol = nvgColour(presentationBackgroundColJuce);
461-
presentationWindowOutlineCol = nvgColour(presentationBackgroundColJuce.contrasting(0.3f));
462-
463-
// Connection / Iolet colours
464-
auto const dataColJuce = PlugDataColours::dataColour;
465-
dataCol = nvgColour(dataColJuce);
466-
auto const sigColJuce = PlugDataColours::signalColour;
467-
sigCol = nvgColour(sigColJuce);
468-
auto const gemColJuce = PlugDataColours::gemColour;
469-
gemCol = nvgColour(gemColJuce);
470-
auto const baseColJuce = PlugDataColours::connectionColour;
471-
baseCol = nvgColour(baseColJuce);
472-
473-
dataColBrighter = nvgColour(dataColJuce.brighter());
474-
sigColBrighter = nvgColour(sigColJuce.brighter());
475-
gemColBrigher = nvgColour(gemColJuce.brighter());
476-
baseColBrigher = nvgColour(baseColJuce.brighter());
477-
478427
dotsLargeImage.setDirty(); // Make sure bg colour actually gets updated
479428
}
480429

@@ -558,7 +507,8 @@ void Canvas::updateFramebuffers(NVGcontext* nvg)
558507
default: break;
559508
}
560509

561-
auto const majorDotColour = canvasMarkingsColJuce.withAlpha(std::min(zoom * 0.8f, 1.0f));
510+
auto markingColour = PlugDataColours::canvasDotsColour.interpolatedWith(PlugDataColours::canvasBackgroundColour, 0.2f);
511+
auto const majorDotColour = markingColour.withAlpha(std::min(zoom * 0.8f, 1.0f));
562512

563513
g.setColour(majorDotColour);
564514
// Draw ellipses on the grid
@@ -571,15 +521,15 @@ void Canvas::updateFramebuffers(NVGcontext* nvg)
571521
continue;
572522
g.setColour(majorDotColour);
573523
if (x % decim == 0 && y % decim == 0)
574-
g.setColour(canvasMarkingsColJuce);
524+
g.setColour(markingColour);
575525
}
576526
// Add half smallest dot offset so the dot isn't at the edge of the texture
577527
// We remove this when we position the texture on the canvas
578528
float const centerX = static_cast<float>(x) + 2.5f;
579529
float const centerY = static_cast<float>(y) + 2.5f;
580530
g.fillEllipse(centerX - ellipseRadius, centerY - ellipseRadius, ellipseRadius * 2.0f, ellipseRadius * 2.0f);
581531
}
582-
} }, NVGImage::RepeatImage, canvasBackgroundColJuce);
532+
} }, NVGImage::RepeatImage, PlugDataColours::canvasBackgroundColour);
583533
}
584534
}
585535

@@ -598,7 +548,7 @@ void Canvas::performRender(NVGcontext* nvg, Rectangle<int> invalidRegion)
598548
invalidRegion /= zoom;
599549

600550
if (isLocked) {
601-
nvgFillColor(nvg, canvasBackgroundCol);
551+
nvgFillColor(nvg, nvgColour(PlugDataColours::canvasBackgroundColour));
602552
nvgFillRect(nvg, invalidRegion.getX(), invalidRegion.getY(), invalidRegion.getWidth(), invalidRegion.getHeight());
603553
} else {
604554
nvgBeginPath(nvg);
@@ -614,7 +564,7 @@ void Canvas::performRender(NVGcontext* nvg, Rectangle<int> invalidRegion)
614564
// offset image texture by 2.5f so no dots are on the edge of the texture
615565
nvgTranslate(nvg, canvasOrigin.x - 2.5f, canvasOrigin.x - 2.5f);
616566

617-
nvgFillColor(nvg, canvasBackgroundCol); // This fixes some glitches but I'm not sure why
567+
nvgFillColor(nvg, nvgColour(PlugDataColours::canvasBackgroundColour)); // This fixes some glitches but I'm not sure why
618568
nvgFill(nvg);
619569

620570
nvgFillPaint(nvg, nvgImagePattern(nvg, 0, 0, gridSizeCommon, gridSizeCommon, 0, dotsLargeImage.getImageId(), 1));
@@ -647,15 +597,15 @@ void Canvas::performRender(NVGcontext* nvg, Rectangle<int> invalidRegion)
647597
nvgLineTo(nvg, pos.x, pos.y + borderHeight);
648598
}
649599
nvgLineStyle(nvg, NVG_LINE_SOLID);
650-
nvgStrokeColor(nvg, canvasBackgroundCol);
600+
nvgStrokeColor(nvg, nvgColour(PlugDataColours::canvasBackgroundColour));
651601
nvgStrokeWidth(nvg, 8.0f);
652602
nvgStroke(nvg);
653603

654-
nvgFillColor(nvg, canvasBackgroundCol);
604+
nvgFillColor(nvg, nvgColour(PlugDataColours::canvasBackgroundColour));
655605
nvgFillRect(nvg, pos.x - 1.0f, pos.y - 1.0f, 2, 2);
656606
}
657607

658-
nvgStrokeColor(nvg, canvasMarkingsCol);
608+
nvgStrokeColor(nvg, nvgColour(PlugDataColours::canvasDotsColour.interpolatedWith(PlugDataColours::canvasBackgroundColour, 0.2f)));
659609
nvgStrokeWidth(nvg, 1.5f);
660610
nvgDashLength(nvg, 8.0f);
661611
nvgLineStyle(nvg, NVG_LINE_DASHED);
@@ -719,7 +669,7 @@ void Canvas::performRender(NVGcontext* nvg, Rectangle<int> invalidRegion)
719669
nvgRect(nvg, 0, 0, infiniteCanvasSize, infiniteCanvasSize);
720670
nvgPathWinding(nvg, NVG_HOLE);
721671
nvgRoundedRect(nvg, pos.getX(), pos.getY(), borderWidth, borderHeight, windowCorner);
722-
nvgFillColor(nvg, presentationBackgroundCol);
672+
nvgFillColor(nvg, nvgColour(PlugDataColours::presentationBackgroundColour));
723673
nvgFill(nvg);
724674

725675
// background drop shadow to simulate a virtual plugin
@@ -735,7 +685,7 @@ void Canvas::performRender(NVGcontext* nvg, Rectangle<int> invalidRegion)
735685
}
736686
auto const shadowImage = nvgImageAlphaPattern(nvg, pos.getX() - shadowSize, pos.getY() - shadowSize, borderArea.getWidth(), borderArea.getHeight(), 0, presentationShadowImage.getImageId(), nvgColour(Colours::black));
737687

738-
nvgStrokeColor(nvg, presentationWindowOutlineCol);
688+
nvgStrokeColor(nvg, nvgColour(PlugDataColours::presentationBackgroundColour.contrasting(0.3f)));
739689
nvgStrokeWidth(nvg, 0.5f / scale);
740690
nvgFillPaint(nvg, shadowImage);
741691
nvgFill(nvg);
@@ -769,7 +719,7 @@ void Canvas::performRender(NVGcontext* nvg, Rectangle<int> invalidRegion)
769719
if (viewport && lasso.isVisible() && !lasso.getBounds().isEmpty()) {
770720
auto lassoBounds = lasso.getBounds();
771721
lassoBounds = lassoBounds.withSize(jmax(lasso.getWidth(), 2), jmax(lasso.getHeight(), 2));
772-
nvgDrawRoundedRect(nvg, lassoBounds.getX(), lassoBounds.getY(), lassoBounds.getWidth(), lassoBounds.getHeight(), lassoCol, lassoOutlineCol, 0.0f);
722+
nvgDrawRoundedRect(nvg, lassoBounds.getX(), lassoBounds.getY(), lassoBounds.getWidth(), lassoBounds.getHeight(), nvgColour(PlugDataColours::objectSelectedOutlineColour.withAlpha(0.075f)), nvgColour(PlugDataColours::canvasBackgroundColour.interpolatedWith(PlugDataColours::objectSelectedOutlineColour, 0.65f)), 0.0f);
773723
}
774724

775725
suggestor->renderAutocompletion(nvg);

Source/Canvas.h

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -275,51 +275,6 @@ class Canvas final : public Component
275275

276276
NVGImage resizeHandleImage;
277277
NVGImage presentationShadowImage;
278-
279-
NVGcolor canvasBackgroundCol;
280-
Colour canvasBackgroundColJuce;
281-
NVGcolor canvasMarkingsCol;
282-
Colour canvasMarkingsColJuce;
283-
284-
Colour canvasTextColJuce;
285-
NVGcolor presentationBackgroundCol;
286-
NVGcolor presentationWindowOutlineCol;
287-
288-
NVGcolor lassoCol;
289-
NVGcolor lassoOutlineCol;
290-
291-
// objectOutlineColourId
292-
NVGcolor objectOutlineCol;
293-
NVGcolor outlineCol;
294-
295-
NVGcolor graphAreaCol;
296-
297-
NVGcolor commentTextCol;
298-
299-
// guiObjectInternalOutlineColour
300-
Colour guiObjectInternalOutlineColJuce;
301-
NVGcolor guiObjectInternalOutlineCol;
302-
NVGcolor guiObjectBackgroundCol;
303-
Colour guiObjectBackgroundColJuce;
304-
305-
NVGcolor textObjectBackgroundCol;
306-
NVGcolor transparentObjectBackgroundCol;
307-
308-
// objectSelectedOutlineColourId
309-
NVGcolor selectedOutlineCol;
310-
NVGcolor indexTextCol;
311-
NVGcolor ioletLockedCol;
312-
313-
NVGcolor baseCol;
314-
NVGcolor dataCol;
315-
NVGcolor sigCol;
316-
NVGcolor gemCol;
317-
318-
NVGcolor dataColBrighter;
319-
NVGcolor sigColBrighter;
320-
NVGcolor gemColBrigher;
321-
NVGcolor baseColBrigher;
322-
323278
private:
324279
void changeListenerCallback(ChangeBroadcaster* c) override;
325280

Source/Components/CanvasSearchHighlight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CanvasSearchHighlight final : public Component
3838
auto const oB = targetObj->getBounds().reduced(Object::margin);
3939

4040
NVGcolor oCol;
41-
NVGcolor iCol = oCol = parentCnv->selectedOutlineCol;
41+
NVGcolor iCol = oCol = nvgColour(PlugDataColours::objectSelectedOutlineColour);
4242
iCol.a = opacity > 1.0f ? 150 : 150 * opacity;
4343
oCol.a = opacity > 1.0f ? 255 : 255 * opacity;
4444
nvgDrawRoundedRect(nvg, oB.getX(), oB.getY(), oB.getWidth(), oB.getHeight(), iCol, oCol, Corners::objectCornerRadius);

Source/Components/GraphArea.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class GraphArea final : public Component
5656
{
5757
auto lineBounds = getLocalBounds().toFloat().reduced(4.0f);
5858

59-
nvgDrawRoundedRect(nvg, lineBounds.getX(), lineBounds.getY(), lineBounds.getWidth(), lineBounds.getHeight(), nvgRGBA(0, 0, 0, 0), canvas->graphAreaCol, Corners::objectCornerRadius);
59+
nvgDrawRoundedRect(nvg, lineBounds.getX(), lineBounds.getY(), lineBounds.getWidth(), lineBounds.getHeight(), nvgRGBA(0, 0, 0, 0), nvgColour(PlugDataColours::graphAreaColour), Corners::objectCornerRadius);
6060

6161
if (!getValue<bool>(canvas->locked)) {
6262
auto& resizeHandleImage = canvas->resizeHandleImage;
@@ -86,7 +86,7 @@ class GraphArea final : public Component
8686

8787
nvgBeginPath(nvg);
8888
nvgRect(nvg, 0, 0, 9, 9);
89-
nvgFillPaint(nvg, nvgImageAlphaPattern(nvg, 0, 0, 9, 9, 0, resizeHandleImage.getImageId(), canvas->graphAreaCol));
89+
nvgFillPaint(nvg, nvgImageAlphaPattern(nvg, 0, 0, 9, 9, 0, resizeHandleImage.getImageId(), nvgColour(PlugDataColours::graphAreaColour)));
9090
nvgFill(nvg);
9191
angle -= 90;
9292
}

Source/Connection.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void Connection::changeListenerCallback(ChangeBroadcaster* source)
127127

128128
void Connection::lookAndFeelChanged()
129129
{
130-
handleColour = outlet->isSignal ? cnv->dataCol : cnv->sigCol;
130+
handleColour = outlet->isSignal ? nvgColour(PlugDataColours::dataColour) : nvgColour(PlugDataColours::signalColour);
131131
shadowColour = nvgColour(PlugDataColours::canvasBackgroundColour.contrasting(0.06f).withAlpha(0.24f));
132132
outlineColour = nvgColour(PlugDataColours::objectOutlineColour);
133133

@@ -144,17 +144,19 @@ void Connection::lookAndFeelChanged()
144144

145145
NVGcolor Connection::getConnectionColour() const
146146
{
147+
Colour c = PlugDataColours::connectionColour;
147148
if (isSelected() || isHovering) {
148149
if (outlet->isSignal) {
149-
return isHovering ? cnv->sigColBrighter : cnv->sigCol;
150+
c = PlugDataColours::signalColour;
150151
}
151-
if (outlet->isGemState) {
152-
return isHovering ? cnv->gemColBrigher : cnv->gemCol;
152+
else if (outlet->isGemState) {
153+
c = PlugDataColours::gemColour;
154+
}
155+
else {
156+
c = PlugDataColours::dataColour;
153157
}
154-
155-
return isHovering ? cnv->dataColBrighter : cnv->dataCol;
156158
}
157-
return cnv->baseCol;
159+
return nvgColour(isHovering ? c.brighter() : c);
158160
}
159161

160162
void Connection::render(NVGcontext* nvg)

Source/Iolet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ void Iolet::render(NVGcontext* nvg)
7676
bool const isLocked = locked || commandLocked;
7777
bool const isHovering = isTargeted && !isLocked;
7878

79-
auto const innerCol = isLocked ? cnv->ioletLockedCol : isSignal ? cnv->sigCol
80-
: isGemState ? cnv->gemCol
81-
: cnv->dataCol;
79+
auto const innerCol = isLocked ? nvgColour(PlugDataColours::canvasBackgroundColour.contrasting(0.5f)) : isSignal ? nvgColour(PlugDataColours::signalColour)
80+
: isGemState ? nvgColour(PlugDataColours::gemColour)
81+
: nvgColour(PlugDataColours::dataColour);
8282
auto iB = PlugDataLook::useSquareIolets ? getLocalBounds().toFloat().reduced(2.0f, 3.33f) : getLocalBounds().toFloat().reduced(2.0f);
8383
if (isHovering)
8484
iB.expand(1.0f, 1.0f);
8585

86-
nvgDrawRoundedRect(nvg, iB.getX(), iB.getY(), iB.getWidth(), iB.getHeight(), innerCol, cnv->objectOutlineCol, PlugDataLook::useSquareIolets ? 0.0f : iB.getWidth() * 0.5f);
86+
nvgDrawRoundedRect(nvg, iB.getX(), iB.getY(), iB.getWidth(), iB.getHeight(), innerCol, nvgColour(PlugDataColours::objectOutlineColour), PlugDataLook::useSquareIolets ? 0.0f : iB.getWidth() * 0.5f);
8787
}
8888

8989
bool Iolet::hitTest(int const x, int const y)

Source/LookAndFeel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct PlugDataColours {
5858

5959
static inline NVGcolor nvgColour(Colour const& c)
6060
{
61-
return nvgRGBA(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha());
61+
return std::bit_cast<NVGcolor>(c); // Both store as BGRA internally
6262
}
6363

6464
inline UnorderedMap<PlugDataColour, std::tuple<String, String, String>> const PlugDataColourNames = {

Source/Object.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ void Object::render(NVGcontext* nvg)
11931193
auto const b = lb.reduced(margin);
11941194

11951195
if (cnv->shouldShowObjectActivity() && !approximatelyEqual(activeStateAlpha, 0.0f)) {
1196-
auto glowColour = cnv->dataCol;
1196+
auto glowColour = nvgColour(PlugDataColours::dataColour);
11971197
glowColour.a = static_cast<uint8_t>(activeStateAlpha * 255);
11981198
nvgSmoothGlow(nvg, lb.getX(), lb.getY(), lb.getWidth(), lb.getHeight(), glowColour, nvgRGBA(0, 0, 0, 0), Corners::objectCornerRadius, 1.1f);
11991199
}
@@ -1210,14 +1210,14 @@ void Object::render(NVGcontext* nvg)
12101210

12111211
nvgBeginPath(nvg);
12121212
nvgRect(nvg, 0, 0, 9, 9);
1213-
nvgFillPaint(nvg, nvgImageAlphaPattern(nvg, 0, 0, 9, 9, 0, resizeHandleImage.getImageId(), cnv->selectedOutlineCol));
1213+
nvgFillPaint(nvg, nvgImageAlphaPattern(nvg, 0, 0, 9, 9, 0, resizeHandleImage.getImageId(), nvgColour(PlugDataColours::objectSelectedOutlineColour)));
12141214
nvgFill(nvg);
12151215
angle -= 90;
12161216
}
12171217
}
12181218

12191219
if (gui && gui->isTransparent() && !getValue<bool>(locked) && !cnv->isGraph) {
1220-
nvgFillColor(nvg, cnv->transparentObjectBackgroundCol);
1220+
nvgFillColor(nvg, nvgColour(PlugDataColours::canvasBackgroundColour.contrasting(0.35f).withAlpha(0.1f)));
12211221
nvgFillRoundedRect(nvg, b.getX(), b.getY(), b.getWidth(), b.getHeight(), Corners::objectCornerRadius);
12221222
}
12231223

@@ -1228,7 +1228,7 @@ void Object::render(NVGcontext* nvg)
12281228
}
12291229

12301230
if (newObjectEditor) {
1231-
nvgDrawRoundedRect(nvg, 0, 0, b.getWidth(), b.getHeight(), cnv->textObjectBackgroundCol, isSelected() ? cnv->selectedOutlineCol : cnv->objectOutlineCol, Corners::objectCornerRadius);
1231+
nvgDrawRoundedRect(nvg, 0, 0, b.getWidth(), b.getHeight(), nvgColour(PlugDataColours::textObjectBackgroundColour), nvgColour(isSelected() ? PlugDataColours::objectSelectedOutlineColour : PlugDataColours::objectOutlineColour), Corners::objectCornerRadius);
12321232
Graphics g(*editor->getNanoLLGC());
12331233
newObjectEditor->paintEntireComponent(g, true);
12341234
}
@@ -1244,10 +1244,10 @@ void Object::render(NVGcontext* nvg)
12441244
nvgEllipse(nvg, fakeInletBounds[0] + fakeInletBounds[2] * 0.5f, fakeInletBounds[1] + fakeInletBounds[3] * 0.5f, fakeInletBounds[2] * 0.5f, fakeInletBounds[3] * 0.5f);
12451245
}
12461246

1247-
nvgFillColor(nvg, outlet->isSignal ? cnv->sigColBrighter : cnv->dataColBrighter);
1247+
nvgFillColor(nvg, nvgColour(outlet->isSignal ? PlugDataColours::signalColour.brighter() : PlugDataColours::dataColour.brighter()));
12481248
nvgFill(nvg);
12491249

1250-
nvgStrokeColor(nvg, cnv->objectOutlineCol);
1250+
nvgStrokeColor(nvg, nvgColour(PlugDataColours::objectOutlineColour));
12511251
nvgStrokeWidth(nvg, 1.0f);
12521252
nvgStroke(nvg);
12531253
}
@@ -1268,13 +1268,13 @@ void Object::render(NVGcontext* nvg)
12681268
int const textWidth = 6 + text.length() * 4;
12691269
auto const indexBounds = b.withSizeKeepingCentre(b.getWidth() + doubleMargin, halfHeight * 2).removeFromRight(textWidth);
12701270

1271-
auto const fillColour = cnv->selectedOutlineCol;
1271+
auto const fillColour = nvgColour(PlugDataColours::objectSelectedOutlineColour);
12721272
nvgDrawRoundedRect(nvg, indexBounds.getX(), indexBounds.getY(), indexBounds.getWidth(), indexBounds.getHeight(), fillColour, fillColour, 2.0f);
12731273

12741274
nvgFontSize(nvg, 8.0f);
12751275
nvgFontFace(nvg, "Inter-Regular");
12761276
nvgTextAlign(nvg, NVG_ALIGN_MIDDLE | NVG_ALIGN_CENTER);
1277-
nvgFillColor(nvg, cnv->indexTextCol);
1277+
nvgFillColor(nvg, nvgColour(PlugDataColours::objectSelectedOutlineColour.contrasting()));
12781278
nvgText(nvg, indexBounds.getCentreX(), indexBounds.getCentreY(), text.c_str(), nullptr);
12791279
}
12801280

Source/Objects/ArrayObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ class ArrayObject final : public ObjectBase {
12621262
graph->render(nvg);
12631263
}
12641264

1265-
nvgStrokeColor(nvg, cnv->guiObjectInternalOutlineCol);
1265+
nvgStrokeColor(nvg, nvgColour(PlugDataColours::guiObjectInternalOutlineColour));
12661266
ticks.render(nvg, b);
12671267
}
12681268

0 commit comments

Comments
 (0)