# Color defined externally Makie

**URL:** https://discourse.julialang.org/t/color-defined-externally-makie/111187
**Category:** General Usage
**Tags:** makie, glmakie
**Created:** [March 5, 2024, 11:12am UTC](https://discourse.julialang.org/t/color-defined-externally-makie/111187 "2024-03-05T11:12:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Enlil50](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/enlil50/32/206539_2.png) [@Enlil50](https://discourse.julialang.org/u/Enlil50)
#### Post date: [March 5, 2024, 11:12am UTC](https://discourse.julialang.org/t/color-defined-externally-makie/111187/1 "2024-03-05T11:12:22Z")

</div>

I want to put the color from a defined string flag

```julia
grey_flag = 1

fig_color = "white"
if grey_flag == 1
    fig_color = "#f5f0f5"
end

f = Figure(backgroundcolor = :fig_color)

```

It throws an error as it attempts to see fig\_color from the default colors of the package.

How can i achieve this?

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [March 5, 2024, 11:55am UTC](https://discourse.julialang.org/t/color-defined-externally-makie/111187/2 "2024-03-05T11:55:12Z")

</div>

The issue is that the `:` prefix in Julia denotes a “symbol”, which means the function thinks you want a color named `:fig_color`, not a color whose name is contained in the variable `fig_color`. Remove the `:` and you should be fine!
