# TextEditor colour changes affects Opacity

**URL:** <https://forum.juce.com/t/texteditor-colour-changes-affects-opacity/8086>\
**Category:** General JUCE discussion\
**Created:** [February 6, 2012, 6:43pm UTC](https://forum.juce.com/t/texteditor-colour-changes-affects-opacity/8086 "2012-02-06T18:43:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsury](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@Tsury](https://forum.juce.com/u/Tsury)\
**Post date:** [February 6, 2012, 6:43pm UTC](https://forum.juce.com/t/texteditor-colour-changes-affects-opacity/8086/1 "2012-02-06T18:43:29Z")

</div>

Hi.

in juce\_TextEditor.cpp there’s the following line (setOpaque):

`
void TextEditor::colourChanged()
{
    setOpaque (findColour (backgroundColourId).isOpaque());
    repaint();
}`

What if I have other colours (outlineColourId, focusedOutlineColourId, etc…) which are transparent but the background colour itself is solid?  
In that case, if I don’t specifically set the opacity to false, changing the background colour afterwards to something solid will reset the opacity to true, resulting in a weird TextEditor…

Currently I commented this line out…  
Is there a way to overcome this issue instead of setting opacity to false after each background change?

Thanks.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 7, 2012, 1:03pm UTC](https://forum.juce.com/t/texteditor-colour-changes-affects-opacity/8086/2 "2012-02-07T13:03:39Z")

</div>

I don’t understand the problem… If the background colour is fully opaque, then the component should be marked as opaque. Why would any of the other colours make any difference?
