Background color doesn't update

void DistortionAudioProcessorEditor::paint (juce::Graphics& g) {
    setPrimaryColour();
    
    g.fillAll(Colour::fromString(primaryColour));
    
    distortionAmount.setColour(Slider::ColourIds::thumbColourId, Colour::fromString(secondaryColour));
    distortionAmount.setColour(Slider::ColourIds::rotarySliderFillColourId, Colour::fromString(intensityColourBW));
    distortionAmount.setColour(Slider::ColourIds::rotarySliderOutlineColourId, Colour::fromString("#070707"));

    distortionType.setColour(Slider::ColourIds::rotarySliderFillColourId, Colour::fromString(intensityColourBW));
    distortionType.setColour(Slider::ColourIds::rotarySliderOutlineColourId, Colour::fromString("#070707"));
    distortionType.setColour(Slider::ColourIds::thumbColourId, Colour::fromString(secondaryColour));

    preGain.setColour(Slider::ColourIds::trackColourId, Colour::fromString(intensityColourBW));
    preGain.setColour(Slider::ColourIds::backgroundColourId, Colour::fromString("#070707"));
    preGain.setColour(Slider::ColourIds::thumbColourId, Colour::fromString(secondaryColour));

    postGain.setColour(Slider::ColourIds::trackColourId, Colour::fromString(intensityColourBW));
    postGain.setColour(Slider::ColourIds::backgroundColourId, Colour::fromString("#070707"));
    postGain.setColour(Slider::ColourIds::thumbColourId, Colour::fromString(secondaryColour));

    float fontSize = getLocalBounds().getWidth() / (640 / 21);

    Font font("Arial Rounded MT Bold", fontSize, 1);

    g.setColour(Colour::fromString(intensityColour));
    g.setFont(font);
    g.drawFittedText (String(int((distortionAmount.getValue() / 0.99) * 100)) + "%", middleRight, juce::Justification::centred, 1);
    g.setColour(Colour::fromString(secondaryColour));
    g.drawFittedText(distortionTypeText, middleLeft, juce::Justification::centred, 1);
}

void DistortionAudioProcessorEditor::setPrimaryColour() {
    int rValue = hexToInt(String(secondaryColour.operator[](1) + secondaryColour.operator[](2))) / 9;
    int gValue = hexToInt(String(secondaryColour.operator[](3) + secondaryColour.operator[](4))) / 9;
    int bValue = hexToInt(String(secondaryColour.operator[](5) + secondaryColour.operator[](6))) / 9;
    primaryColour = colourFromInts(rValue, gValue, bValue);
}


As shown in the screenshots, when running the program, it does set the background correctly, but when I change the settings, only the background from the sliders get updated.
How do I make the background of the window itself change after the application has already started up?

You’re probably just missing a call to repaint to tell the component that it needs to be completely redrawn.

1 Like

this indeed fixed it!!
thank you!!