# Set a user defined lookup table to replace default "Cool to Warm"

**URL:** https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847
**Category:** Development
**Created:** [October 25, 2019, 1:43pm UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847 "2019-10-25T13:43:07Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [October 25, 2019, 1:43pm UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/1 "2019-10-25T13:43:08Z")

</div>

Dear Expert,

I found the default lookup table is “Cool to Warm”, How can i change this default one into “hsv”.

And further, i want to use a user specific defined lookup table, how can i do it in programmatic way ,  
to make it as as the default lookup table

Thanks and Best Regards,  
Sharon

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2019, 2:16pm UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/2 "2019-10-25T14:16:38Z")

</div>

N̶o̶t̶ ̶p̶o̶s̶s̶i̶b̶l̶e̶ ̶i̶n̶ ̶P̶a̶r̶a̶V̶i̶e̶w̶,̶ ̶b̶u̶t̶ ̶a̶ ̶g̶r̶e̶a̶t̶ ̶f̶e̶a̶t̶u̶r̶e̶ ̶i̶d̶e̶a̶ ̶n̶o̶n̶e̶t̶h̶e̶l̶e̶s̶s̶.̶ ̶ ̶P̶l̶e̶a̶s̶e̶ ̶o̶p̶e̶n̶ ̶a̶n̶ ̶i̶s̶s̶u̶e̶ ̶o̶n̶ ̶o̶u̶r̶ ̶g̶i̶t̶l̶a̶b̶ ̶t̶o̶ ̶t̶r̶a̶c̶k̶ ̶i̶t̶.̶

Not true, see below.

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [October 26, 2019, 1:26am UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/3 "2019-10-26T01:26:30Z")

</div>

Thank you Mathieu for you reply!  
OK, I will put it on the gitlab.

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [October 26, 2019, 7:58am UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/4 "2019-10-26T07:58:44Z")

</div>

Hi Mathieu,

what about if set a user defined color for a MultiBlockDataSet in the reader plugin?  
How can do this?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 28, 2019, 7:50am UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/5 "2019-10-28T07:50:17Z")

</div>

`T̶h̶e̶ ̶w̶o̶u̶l̶d̶ ̶b̶e̶ ̶t̶h̶e̶ ̶s̶a̶m̶e̶ ̶m̶i̶s̶s̶i̶n̶g̶ ̶f̶e̶a̶t̶u̶r̶e̶ ̶i̶m̶o̶.̶`

Not true, see below.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [October 28, 2019, 2:48pm UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/6 "2019-10-28T14:48:16Z")

</div>

Actually, this is possible in ParaView. You can set a custom default color map via the ParaView settings controller. Set up a `std::string` with some JSON that defines the default color map:

```json
{
        "lookup_tables" : 
        {
                "PVLookupTable" : 
                {
                        "ColorSpace" : 0,
                        "RGBPoints" : 
                        [
                                -0.97492790222167969,
                                1.0,
                                0.0,
                                0.0,
                                -0.6499512848625183,
                                1.0,
                                0.0,
                                1.0,
                                -0.32497564243125909,
                                0.0,
                                0.0,
                                1.0,
                                0.0,
                                0.0,
                                1.0,
                                1.0,
                                0.32497271764755253,
                                0.0,
                                1.0,
                                0.0,
                                0.64994543529510507,
                                1.0,
                                1.0,
                                0.0,
                                0.97492790222167969,
                                1.0,
                                0.0,
                                0.0
                        ]
                }
        }
}

```

This happens to be the “hsv” color map (which I highly recommend you avoid, but that’s a separate topic).

To load the JSON, use

```auto
#include <vtkSMSettings.h>

std::string settings = "your json here";
vtkSMSettings::GetInstance()->AddCollectionFromString(settings, VTK_DOUBLE_MAX);

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 30, 2019, 11:35am UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/7 "2019-10-30T11:35:19Z")

</div>

So the feature is indeed already in ParaView GUI, albeit a litle bit hidden.

Here is how to do it :

- Open ParaView
- Show your dataset
- Modify the color map to your needs
- Click on this button at the very bottom of the color map editor  
 ![2019-10-30-131504_191x70_scrot](https://discourse.paraview.org/uploads/default/original/2X/2/2d9fca10cbc8406638ed67e2bdfdf7a03c2c5df0.png)
- This color map is now the default one for any **newly** displayed data
- It is saved in the settings, so it will stay the default even if you start ParaView again
- It works with categories as well

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [November 30, 2019, 9:52am UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/8 "2019-11-30T09:52:49Z")

</div>

Hi Cory,

Thank you very much for your reply!!  
sorry for coming back later…

What about if i want to load different sources and want them to use different lookup table?  
In my situation, i need load 3 different sources, and first source i want to use block index color as default, the second source i want use lookup table as default, the third source i want to use another lookup table as default.

Thanks and Best Regards,  
Sharon

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [November 30, 2019, 9:54am UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/9 "2019-11-30T09:54:10Z")

</div>

Hi Mathieu,

Thank you very much for your reply!!

Just as i replied to Cory, i need different default color schema for different source…

Thanks and Best Regards,  
Sharon

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 2, 2019, 9:29am UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/10 "2019-12-02T09:29:26Z")

</div>

Not supported in ParaView yet.

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 2, 2019, 12:15pm UTC](https://discourse.paraview.org/t/set-a-user-defined-lookup-table-to-replace-default-cool-to-warm/2847/11 "2019-12-02T12:15:40Z")

</div>

Thank you Mathieu for your reply!  
Best Regards
