[Closed] How to set undocumented UI colors?
Hi guys, I’m trying to set some interface colors by MaxScript using colorMan interface. Unfortunately the colors I’m looking for are listed in Max customization panel, but aren’t specified in MaxScript Reference, which shows only a bunch of them. Is there a way to access those undocumented color settings? A way to make Max list them?
Thank you.
- Enrico
what do you know about color which you want to change? is it its id, or name and category?
If I get it right I need the ID to change the color through:
<boolean>colorMan.setColor <string>color <point3>colorValue
where <string>color is the ID
I’d like to change the 3D Painter system colors, so according to the Customize User Interface, Color panel, I should have in example:
category: “3D Painter”
name: “Gizmo Color”, “Mirror Reproject”, “Normal Color”, …, and so on
I miss the ID. With a fast test I found out numbers from 1 to 9 are associated to colors from “Track View” category, but couldn’t discover anything else.
How do I get the color ID? Thanks
- Enrico
To get and set color with colorMan interface you have to know the name of the color which this color was registered. You don’t know the name for custom colors. Here is a workaround:
- Max stores color settings in *.clr file. It’s the same as INI file format. You can use setINIsetting and getINIsetting.
- To get current UI color file:
ini = colorMan.getColorFile()
- Find colors that match your search:
count = (getINIsetting ini "CustomColors" "NumColors") as integer
for k=0 to count-1 do
(
index = "_" + (k as string)
id = getINIsetting ini "CustomColors" ("ID"+index)
col = getINIsetting ini "CustomColors" ("Color"+index)
name = getINIsetting ini "CustomColors" ("Name"+index)
category = getINIsetting ini "CustomColors" ("Category"+index)
-- if <here is your conditions> do <...>
)
- Code and Decode Color Value:
fn getColor col =
(
c = col as integer
r = mod c 256
g = mod (c/256) 256
b = mod (c/1024) 256
((color r g b) as point3)/255
)
fn setColor c = -- c as point3 ([1,1,1] == white)
(
c = (c*255) as color
c = 1024*(c.b as integer) + 256*(c.g as integer) + (c.r as integer)
col = c as string
)
- Set new color with setINIsetting ini …
- Reload clr file (colorMan.loadColorFile ini) or colorMan.repaintUI #repaintAll
[color=white]I don’t know easier way. Maybe anyone else knows. [/color]
That’s awesome! Thank you very much Denis for your effort. I’ll make good use of that
- Enrico
p.s.
As soon as I’m done with PainterInterface based tools, I’ll start implementing your doped mouseTrack