# Using predefined color palettes from root 6 to root 5

**URL:** <https://root-forum.cern.ch/t/using-predefined-color-palettes-from-root-6-to-root-5/41835>\
**Category:** Newbie\
**Created:** [October 13, 2020, 4:26am UTC](https://root-forum.cern.ch/t/using-predefined-color-palettes-from-root-6-to-root-5/41835 "2020-10-13T04:26:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [October 13, 2020, 6:08am UTC](https://root-forum.cern.ch/t/using-predefined-color-palettes-from-root-6-to-root-5/41835/2 "2020-10-13T06:08:47Z")

</div>

You can create a palette  
[https://root.cern.ch/doc/master/classTColor.html#C05](https://root.cern.ch/doc/master/classTColor.html#C05)

> [@Colour palette for periodic z-axis](https://root-forum.cern.ch/t/colour-palette-for-periodic-z-axis/41749/2):
>
> You can try creating your own colour palette, ensuring that the last point on the scale is the same colour as the first one. See the CreateGradientColorTable example in the “Color palettes” section on the page you linked. Based on the example there, you could have: { TCanvas \*c2 = new TCanvas("c2","c2",0,0,600,400); TF2 \*f2 = new TF2("f2","0.1+(1-(x-2)\*(x-2))\*(1-(y-2)\*(y-2))",1,3,1,3); const Int\_t Number = 4; Double\_t Red[Number] = { 1.00, 0.00, 0.00, 1.00}; Double\_t Green[Nu…

using the colours you want. You can see the values for the predefined palettes here:  
[ROOT: core/base/src/TColor.cxx Source File](https://root.cern/doc/master/TColor_8cxx_source.html#l02414)  
Scroll down to find Black Body (case 70). I’m not sure if the alpha option is available in ROOT 5, but you can just omit it, as in the “periodic z-axis” example above.

---

_[View the full topic](https://root-forum.cern.ch/t/using-predefined-color-palettes-from-root-6-to-root-5/41835)._
