@@ -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
425425void 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);
0 commit comments