Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Failed to change the "InactiveTabBackground" color by Python

$
0
0

hi guys!
I was trying to modify the color of Rhino interface these days by Python.
All the color change i expected had almost taken effect,
except for “Rhino.Options.UiPaintColors.InactiveTabBackground”.
Whatever color i set for InactiveTabBackground,
it just keep the default Color [A=0, R=255, G=255, B=255].

At the same time, i found something strange.
If i set a newcolor = default Color [A=0, R=255, G=255, B=255],
the codes would change “Rhino.Options.UiPaintColors.NormalEnd” color to its default.
If i set a newcolor = other color,
the codes would change “Rhino.Options.UiPaintColors.NormalEnd” color to the newcolor.

I was really confused.
I’m a beginner in Python, maybe i have not found the right way.
Here’s the codes I wrote for test.

import Rhino.ApplicationSettings.AppearanceSettings as ras
import Rhino.ApplicationSettings.PaintColor as PaintColor
import rhinoscriptsyntax as rs

newcolor = rs.CreateColor([255,255,255,0])

# PaintColor(23):InactiveTabBackground
# the codes below will not change the InactiveTabBackground color 
# but i found something strange
# if newcolor = default Color [A=0, R=255, G=255, B=255]
# the codes will change "Rhino.Options.UiPaintColors.NormalEnd" color to its default
# if newcolor = other color
# the codes will change "Rhino.Options.UiPaintColors.NormalEnd" color to newcolor

ras.SetPaintColor(PaintColor(23),newcolor)

rs.Redraw()

Can someone help me?
I will be grateful!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles