# Color Pallete functions?

**URL:** <https://discourse.julialang.org/t/color-pallete-functions/40959>\
**Category:** General Usage\
**Tags:** question, plotting\
**Created:** [June 7, 2020, 11:16pm UTC](https://discourse.julialang.org/t/color-pallete-functions/40959 "2020-06-07T23:16:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaoLi111](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haoli111/32/10982_2.png) [@HaoLi111](https://discourse.julialang.org/u/HaoLi111)\
**Post date:** [June 7, 2020, 11:16pm UTC](https://discourse.julialang.org/t/color-pallete-functions/40959/1 "2020-06-07T23:16:26Z")

</div>

We can select color palletes in Plots.jl, but is there any function that can take an normalized vector ranging from 0-1 and give an output of an array of color vectors of RGB[R,G,B]  
For example, 0 gets mapped onto RGB[0,0,0]  
1 gets mapped onto RGB[1,1,1]  
We can manually wite that easily, but is there any option to generate such mapping with same color pallete with Plot.jl so that even I am not using its backends, I can still generate plot with same style.

---

<div class="post-metadata">

**Author:** ![L\_Adam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/l_adam/32/12086_2.png) [@L\_Adam](https://discourse.julialang.org/u/L_Adam)\
**Post date:** [June 8, 2020, 2:42am UTC](https://discourse.julialang.org/t/color-pallete-functions/40959/2 "2020-06-08T02:42:58Z")

</div>

I believe you are looking for this [Colors.jl](http://juliagraphics.github.io/Colors.jl/stable/colormapsandcolorscales/)

---

<div class="post-metadata">

**Author:** ![HaoLi111](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haoli111/32/10982_2.png) [@HaoLi111](https://discourse.julialang.org/u/HaoLi111)\
**Post date:** [June 8, 2020, 3:45am UTC](https://discourse.julialang.org/t/color-pallete-functions/40959/3 "2020-06-08T03:45:54Z")

</div>

Thanks! The interpolation solved one part of the problem. So I first generate color sequences with Color jl, and specify what color to use by putting a color series with the same length of x into the “color” label in plots. If we keep using the same color pallete, the style would be consistent,

---

<div class="post-metadata">

**Author:** ![HaoLi111](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haoli111/32/10982_2.png) [@HaoLi111](https://discourse.julialang.org/u/HaoLi111)\
**Post date:** [June 8, 2020, 3:51am UTC](https://discourse.julialang.org/t/color-pallete-functions/40959/4 "2020-06-08T03:51:01Z")

</div>

However, what should I use to extract the palletes from Plots.jl? I really liked the default color scheme and it seemed that we cannot conveniently extract it to use as functions to give RGB/RGBA when we render images with other packages, for example Images.jl

---

<div class="post-metadata">

**Author:** ![L\_Adam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/l_adam/32/12086_2.png) [@L\_Adam](https://discourse.julialang.org/u/L_Adam)\
**Post date:** [June 8, 2020, 4:59am UTC](https://discourse.julialang.org/t/color-pallete-functions/40959/5 "2020-06-08T04:59:16Z")

</div>

```julia
julia> using Plots
julia> palette(:default)
17-element Array{RGBA{Float64},1} with eltype RGBA{Float64}:
 RGBA{Float64}(0.0,0.6056031611752245,0.978680117569607,1.0)                   
 RGBA{Float64}(0.8888735002725198,0.43564919034818983,0.2781229361419438,1.0)  
 RGBA{Float64}(0.2422242978521988,0.6432750931576304,0.30444865153411527,1.0)  
 RGBA{Float64}(0.7644401754934356,0.44411177946877645,0.824297535923276,1.0)   
 RGBA{Float64}(0.6755439572114058,0.5556623322045814,0.09423433626639477,1.0)  
 RGBA{Float64}(4.821181623260173e-7,0.665758981292356,0.6809969518707948,1.0)  
 RGBA{Float64}(0.930767491919665,0.3674771896571417,0.575769966754783,1.0)     
 RGBA{Float64}(0.7769816661712934,0.5097431319944512,0.14642525695554937,1.0)  
 RGBA{Float64}(3.8077344020392977e-7,0.6642678029460115,0.5529508754522483,1.0)
 RGBA{Float64}(0.5584649641150807,0.5934846564332882,0.11748125233232101,1.0)  
 RGBA{Float64}(5.947623898072685e-7,0.6608785231434255,0.7981787608414297,1.0) 
 RGBA{Float64}(0.6096707676128647,0.49918492100827777,0.9117812665042642,1.0)  
 RGBA{Float64}(0.3800016049820352,0.5510532724353505,0.9665056985227146,1.0)   
 RGBA{Float64}(0.9421816479542181,0.37516423354097583,0.4518168202944591,1.0)  
 RGBA{Float64}(0.8684020893043972,0.39598936399548457,0.7135147524811879,1.0)  
 RGBA{Float64}(0.4231467436463083,0.6224954944199981,0.19877060252130474,1.0)  
 RGBA{Float64}(0.44443694052298,0.5499584966471007,0.415536905797096,1.0)  

```

I’m not sure if this is what you want. You could dig into [ColorSchemes](http://docs.juliaplots.org/latest/generated/colorschemes/) section in Plots doc

---

<div class="post-metadata">

**Author:** ![HaoLi111](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haoli111/32/10982_2.png) [@HaoLi111](https://discourse.julialang.org/u/HaoLi111)\
**Post date:** [June 10, 2020, 7:28am UTC](https://discourse.julialang.org/t/color-pallete-functions/40959/6 "2020-06-10T07:28:15Z")

</div>

Thanks! this is very awesome! In this way we can makem illustrations with Plots.jl, animations with makie, signal accentuations with image.jl all using the same pallete!
