# SVG turned black

**URL:** <https://forum.getkirby.com/t/svg-turned-black/19026>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 9, 2020, 12:46pm UTC](https://forum.getkirby.com/t/svg-turned-black/19026 "2020-08-09T12:46:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![S1SYPHOS](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/s1syphos/32/3671_2.png) [@S1SYPHOS](https://forum.getkirby.com/u/S1SYPHOS)\
**Post date:** [August 9, 2020, 12:46pm UTC](https://forum.getkirby.com/t/svg-turned-black/19026/1 "2020-08-09T12:46:32Z")

</div>

Hey there,

I coded this piece to return either a file object or inline SVG code, which lives inside a plugin’s page method. `$content` holds the SVG/XML string which is valid:

```php
if (F::write(A::join([$path, $filename . '.svg'], '/'), $content)) {
    $file = new File([
        'parent' => $this,
        'filename' => $filename . '.svg'
    ]);

    if (option('me.myplugin.inline') === true) {
        return svg($file);
    }

    return $file;
}

```

Now … the file gets created and looks as expected. However, when `inline` is `true`, the returned SVG code is identical, but shows as big black circle (instead of being colorful). Any ideas are appreciated!

Cheers,  
S1S

---

<div class="post-metadata">

**Author:** ![S1SYPHOS](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/s1syphos/32/3671_2.png) [@S1SYPHOS](https://forum.getkirby.com/u/S1SYPHOS)\
**Post date:** [August 9, 2020, 1:02pm UTC](https://forum.getkirby.com/t/svg-turned-black/19026/2 "2020-08-09T13:02:24Z")

</div>

Alright - CSP violation …
