# Applying color to volume through script?

**URL:** <https://discourse.slicer.org/t/applying-color-to-volume-through-script/17923>\
**Category:** Development\
**Created:** [June 2, 2021, 11:54am UTC](https://discourse.slicer.org/t/applying-color-to-volume-through-script/17923 "2021-06-02T11:54:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chintha\_Siva\_Prasad](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chintha_siva_prasad/32/7766_2.png) [@Chintha\_Siva\_Prasad](https://discourse.slicer.org/u/Chintha_Siva_Prasad)\
**Post date:** [June 2, 2021, 11:54am UTC](https://discourse.slicer.org/t/applying-color-to-volume-through-script/17923/1 "2021-06-02T11:54:58Z")

</div>

I have a volume and want to apply color to it as we do in the segment editor module.How can I apply color to it from code?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 2, 2021, 1:43pm UTC](https://discourse.slicer.org/t/applying-color-to-volume-through-script/17923/2 "2021-06-02T13:43:06Z")

</div>

You can find code examples to all commonly needed operations in the script repository - see how to change the lookup table for a volume [here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#change-window-level-brightness-contrast-or-colormap-of-a-volume).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 4, 2021, 3:35am UTC](https://discourse.slicer.org/t/applying-color-to-volume-through-script/17923/3 "2021-06-04T03:35:56Z")

</div>

A post was split to a new topic: [How to change Segment Editor Paint effect options from Python script](https://discourse.slicer.org/t/how-to-change-segment-editor-paint-effect-options-from-python-script/17944)
