# Transparent of outline of TextEditor

**URL:** <https://forum.juce.com/t/transparent-of-outline-of-texteditor/32880>\
**Category:** General JUCE discussion\
**Created:** [April 16, 2019, 2:29pm UTC](https://forum.juce.com/t/transparent-of-outline-of-texteditor/32880 "2019-04-16T14:29:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pajczur](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@pajczur](https://forum.juce.com/u/pajczur)\
**Post date:** [April 16, 2019, 2:29pm UTC](https://forum.juce.com/t/transparent-of-outline-of-texteditor/32880/1 "2019-04-16T14:29:17Z")

</div>

In the JUCE documentation there is written:

> outlineColourId - If this is non-transparent, it will be used to draw a box around the edge of the component.

But I can’t find anywhere the info how to make it transparent or not transparent. Could anyone help me?

---

<div class="post-metadata">

**Author:** ![alassandro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/alassandro/32/4297_2.png) [@alassandro](https://forum.juce.com/u/alassandro)\
**Post date:** [April 16, 2019, 2:52pm UTC](https://forum.juce.com/t/transparent-of-outline-of-texteditor/32880/2 "2019-04-16T14:52:42Z")

</div>

> [@pajczur](#):
>
> transparent or not transparent

```auto
editor.setColour(TextEditor::outlineColourId, Colours::red); // non-transparent red
editor.setColour(TextEditor::outlineColourId, Colours::red.withAlpha(0.0f)); // transparent red

```

“Alpha” will be the same as “transparency” for colours

---

<div class="post-metadata">

**Author:** ![pajczur](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@pajczur](https://forum.juce.com/u/pajczur)\
**Post date:** [April 16, 2019, 3:01pm UTC](https://forum.juce.com/t/transparent-of-outline-of-texteditor/32880/3 "2019-04-16T15:01:56Z")

</div>

Great thanks, I tried that already, and it doesn’t work so I suppose it’s some problem with my lookAndFeelMethod in which I have method like that:

```
Label* createSliderTextBox(Slider &slider) override
{
	auto l = new SliderLabel();
	l->setJustificationType(Justification::centred);
	l->setKeyboardType(TextInputTarget::decimalKeyboard);
	l->setColour(Label::textColourId, slider.findColour(Slider::textBoxTextColourId));
    l->setColour(Label::outlineColourId, myColour);
    // ALL ABOVE WORKS

    // BUT THAT DOESN"T WORK:
    l->setColour(TextEditor::outlineColourId, Colours::black.withAlpha(1.0f));
    // NO MATTER WHAT COLOUR I USE THE OUTLINE OF TEXT EDITOR IS ALWAYS THE SAME.
}

```

I also wonder how to change the thickness of `Label` and `TextEditor` outlines.

---

<div class="post-metadata">

**Author:** ![alassandro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/alassandro/32/4297_2.png) [@alassandro](https://forum.juce.com/u/alassandro)\
**Post date:** [April 16, 2019, 3:11pm UTC](https://forum.juce.com/t/transparent-of-outline-of-texteditor/32880/4 "2019-04-16T15:11:49Z")

</div>

Components are only going to use the `ColourIds` associated with them generally, which is why `Label::outlineColourId` works and `TextEditor::outlineColourId` does not, and the default `LookAndFeel` doesn’t seem to try inheriting any `ColourIds` from parents in this case:

> <https://github.com/WeAreROLI/JUCE/blob/master/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp#L679>

You’ll want to override that `LookAndFeel` maybe just use the same code but use `findColour(..., true);` inside those `setColour()` methods… the boolean argument tells `findColour()` that it should search the parent component as well

---

<div class="post-metadata">

**Author:** ![pajczur](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@pajczur](https://forum.juce.com/u/pajczur)\
**Post date:** [April 16, 2019, 3:13pm UTC](https://forum.juce.com/t/transparent-of-outline-of-texteditor/32880/5 "2019-04-16T15:13:07Z")

</div>

I will try that.  
Thanks man
