# Getting the "current seriescolor" in a recipe

**URL:** <https://discourse.julialang.org/t/getting-the-current-seriescolor-in-a-recipe/42675>\
**Category:** Visualization\
**Tags:** plotting, colors, plots, gr, recipe\
**Created:** [July 7, 2020, 12:46pm UTC](https://discourse.julialang.org/t/getting-the-current-seriescolor-in-a-recipe/42675 "2020-07-07T12:46:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![met-j](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/met-j/32/21919_2.png) [@met-j](https://discourse.julialang.org/u/met-j)\
**Post date:** [July 7, 2020, 12:46pm UTC](https://discourse.julialang.org/t/getting-the-current-seriescolor-in-a-recipe/42675/1 "2020-07-07T12:46:36Z")

</div>

I am working on a `Plots` recipe based on the `marginalhist` example.  
I would like to make the `fillcolor` of the histogram subplots dependend on the `colorgradient` used.  
While this works manually

```julia
seriescolor --> cgrad(:starrynight)
fillcolor --> get(palette(:starrynight), 0.1)

```

I am not sure how to do something like:

```julia
seriescolor --> cgrad(:starrynight)
fillcolor --> get(palette(seriescolor), 0.1)

```

Using the gr backend I am on

- julia release-1.5
- Plots v1.5.3,
- RecipesBase v1.0.1
- StatsPlots v0.14.6

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [July 8, 2020, 8:02am UTC](https://discourse.julialang.org/t/getting-the-current-seriescolor-in-a-recipe/42675/2 "2020-07-08T08:02:06Z")

</div>

I’m not completely sure that I fully get what you are after, but does the following give, what you need?

```julia
seriescolor --> cgrad(:starrynight)
fillcolor --> get(palette(plotattributes[:seriescolor]), 0.1)

```

---

<div class="post-metadata">

**Author:** ![met-j](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/met-j/32/21919_2.png) [@met-j](https://discourse.julialang.org/u/met-j)\
**Post date:** [July 8, 2020, 8:29am UTC](https://discourse.julialang.org/t/getting-the-current-seriescolor-in-a-recipe/42675/3 "2020-07-08T08:29:46Z")

</div>

> [@BeastyBlacksmith](#):
>
> ```julia
> get(palette(plotattributes[:seriescolor]), 0.1)
> 
> ```

👌 Thanks. This chain is exactly what I was looking for.
