# How to change the color panel for Draw("colz") for TH2 plots?

**URL:** <https://root-forum.cern.ch/t/how-to-change-the-color-panel-for-draw-colz-for-th2-plots/26087>\
**Category:** ROOT\
**Created:** [September 2, 2017, 4:14pm UTC](https://root-forum.cern.ch/t/how-to-change-the-color-panel-for-draw-colz-for-th2-plots/26087 "2017-09-02T16:14:19Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [September 5, 2017, 3:16pm UTC](https://root-forum.cern.ch/t/how-to-change-the-color-panel-for-draw-colz-for-th2-plots/26087/8 "2017-09-05T15:16:04Z")

</div>

`TColor::InvertPallete` was added in version 6.10.00. Unfortunately, it looks like it was not added to the Change log for that version. Using the [commit](https://root-forum.cern.ch/t/inverted-color-palettes/24826) mentioned in the forum topic below you can add the functionality to any version by performing the same reversal if you have the palette. Another unfortunate issue is that `TColor::GetPalette` was not added until ROOT 6.11.01.

```cpp
std::reverse(palette.fArray, palette.fArray + palette.GetSize());
TColor::SetPalette(palette);

```

Forum post for the idea:

> [@Inverted Color Palettes](https://root-forum.cern.ch/t/inverted-color-palettes/24826):
>
> Hi, Is it possible to easily invert the predefined color palettes? There are some great palettes predefined, but in my opinion they are defined backwards. For example, kCherry runs from black to white through red. This looks good for 3D renderings, but is confusing for 2D histograms rendered with the "COLZ" option as empty bins (or those below the minimum) and the maximum bins are nearly the same color. I’d like the colors to run from white to black through red. This is true for many others as …

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-change-the-color-panel-for-draw-colz-for-th2-plots/26087)._
