# How to change color of text and Bar of RGB slice view?

**URL:** <https://discourse.slicer.org/t/how-to-change-color-of-text-and-bar-of-rgb-slice-view/33188>\
**Category:** Development\
**Created:** [December 3, 2023, 1:55pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-text-and-bar-of-rgb-slice-view/33188 "2023-12-03T13:55:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![1116](https://avatars.discourse-cdn.com/v4/letter/1/439d5e/32.png) [@1116](https://discourse.slicer.org/u/1116)\
**Post date:** [December 3, 2023, 1:55pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-text-and-bar-of-rgb-slice-view/33188/1 "2023-12-03T13:55:38Z")

</div>

I want to change color of text and bar in the RGB slice view.  
Is it possible to change the part I circled by python script?

![스크린샷 2023-12-03 225450](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/1/919acbd190d19b0b88f745b343d22df7bc1520f7.png)  
Thank you!

---

<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:** [December 3, 2023, 10:20pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-text-and-bar-of-rgb-slice-view/33188/2 "2023-12-03T22:20:15Z")

</div>

Color of the slice view is stored in the slice view node and you can change it like this:

```auto
slicer.util.getFirstNodeByClassByName('vtkMRMLSliceNode', 'Red').SetLayoutColor(1,0,1)

```

---

<div class="post-metadata">

**Author:** ![1116](https://avatars.discourse-cdn.com/v4/letter/1/439d5e/32.png) [@1116](https://discourse.slicer.org/u/1116)\
**Post date:** [December 3, 2023, 11:31pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-text-and-bar-of-rgb-slice-view/33188/3 "2023-12-03T23:31:25Z")

</div>

Thank you! It works well

I have one more question.  
Is it possible to approach the top bar of slicer by QT & Python script?  
`slicer.app.styleSheet="QWidget{color:#F0F6FC;background-color: #464646;}"`  
This command changed all the widget color except the top bar.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/3/33d6da73eedf80c5aefa69c98de7628370eabc53.png)

---

<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:** [December 4, 2023, 12:42pm UTC](https://discourse.slicer.org/t/how-to-change-color-of-text-and-bar-of-rgb-slice-view/33188/4 "2023-12-04T12:42:03Z")

</div>

It might be possible that some parts of the application window are drawn by the operating system, but most likely you can customize everything. The issue in the code snippet above might be that you only set custom style for QWidget instances and not for the main window class.
