# \[SOLVED\] Drawable::replaceColour() - how does it work?

**URL:** <https://forum.juce.com/t/solved-drawable-replacecolour-how-does-it-work/45566>\
**Category:** General JUCE discussion\
**Created:** [April 18, 2021, 2:16pm UTC](https://forum.juce.com/t/solved-drawable-replacecolour-how-does-it-work/45566 "2021-04-18T14:16:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [April 18, 2021, 2:16pm UTC](https://forum.juce.com/t/solved-drawable-replacecolour-how-does-it-work/45566/1 "2021-04-18T14:16:44Z")

</div>

I’m trying to load an SVG into a `Drawable` and then replace the color. However it doesn’t seem to detect the color for some reason. I made sure the SVG uses a pure red exclusively, as a fill, with no gradient.

My code is:

```auto
m_logo = Drawable::createFromSVGFile(File("/path/to/logo.svg"));
DBG("Colour found: " << (int)m_logo->replaceColour(Colour(0xFF, 0x00, 0x00), m_color_content));

```

This will always output `Color found: 0`. I’ve attached the logo in case it helps!  
[logo.zip](https://forum.juce.com/uploads/short-url/fRYndMtLY3Yavz46evXUfJtONnJ.zip) (4.9 KB)

---

<div class="post-metadata">

**Author:** ![TheWaveWarden](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thewavewarden/32/13708_2.png) [@TheWaveWarden](https://forum.juce.com/u/TheWaveWarden)\
**Post date:** [April 18, 2021, 5:07pm UTC](https://forum.juce.com/t/solved-drawable-replacecolour-how-does-it-work/45566/2 "2021-04-18T17:07:13Z")

</div>

I took a deep dive into the underlying JUCE code:

Turns out that the color I used was in fact not pure red, but had an alpha value. After rechecking with Inkscape, I could confirm that this was the case. However when editing the alpha value in Inkscape, it gets reset to to some random other value after saving.

So it boils down to my buggy Inkscape version (I’m still on one of the 0.9 pre-release versions). Time to upgrade!

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [April 18, 2021, 5:24pm UTC](https://forum.juce.com/t/solved-drawable-replacecolour-how-does-it-work/45566/3 "2021-04-18T17:24:02Z")

</div>

> [@TheWaveWarden](#):
>
> So it boils down to my buggy Inkscape version

Isn’t that _every_ inkscape version? 😉
