Reuse Color scheme from grafana


I am currently developing a panel where we want to reuse the same colour palette as grafana, but I cannot seem to find exactly how to get it when i was checking out the grafana code

=> it looks like I need the palette from the theme and the label of the colour palette from the config and i tried multiple functions i found in the grafana code base, but I could not manage to get the correct colour palette.

Is there some documentation somewhere on the subject?

Have you checked out the styles guides in the Grafana repository?:


those only seem to talk about the color palette from the theme, but not about how to get the color-sheme for the config (e.g. timeseries-panel => standard options => color":{“mode”:“continuous-GrYlRd”}})

i need to map that string (“continuous-GrYlRd”) to the same color palette that grafana uses for that param, but i haven’t been able to figure out how to do this

am i missing something?

I’m not sure you can get a full color palette for the field options, but you can get the color for a specific value in your query results by using the display processor. The display processor uses the color from the standard options.

Each data frame field has a method called display that accepts a value and returns an object with information on that value should be presented.

thnak you, i will check that out