Interface: colorMan

The colorMan Core Interface exposes the Color Manager to MAXScript.

Within 3ds Max, using the Main Menu > Customize > Customize User Interface > Colors tab, you can alter the colors used for various UI elements, change the saturation, value and transparency of elements, and load and save color schemes.

NOTE:After making any color changes, you must call colorMan.repaintUI #repaintAll to apply the changes and synchronize with the customize dialog.

   

Properties:

colorMan.colorTheme 
colorTheme enums: {#dark|#light}

Gets or sets the Color Theme as a name value. Available in in 3ds Max 2017 and higher.

   

Methods:

<enum> colorMan.getColorTheme()

getColorTheme enums: {#dark|#light}

Gets the current Color Theme as a name value. Available in in 3ds Max 2017 and higher.

   

<void> colorMan.setColorTheme <enum>theme

theme enums: {#dark|#light}

Sets the current Color Theme. Available in in 3ds Max 2017 and higher.

   

<enum>colorMan.getColorSchemeType() 

getColorSchemeType enums: {#customColor|#standardWindows|#windowsTheme}

Returns the current color scheme type as a name value.

Available in 3ds Max 2010 and higher up to 3ds Max 2017.

   

<enum>colorMan.setColorSchemeType <enum>type 

setColorSchemeType enums: {#customColor|#standardWindows|#windowsTheme}
type enums: {#customColor|#standardWindows|#windowsTheme}

Sets the color scheme type to the specified name and returns the actual color scheme type as result.

Available in 3ds Max 2010 and higher up to 3ds Max 2017.

   

<boolean>colorMan.useStandardWindowsColors() 

In versions prior to 3ds Max 2010, returned true if the standard windows colors were used and false if custom colors were used.

   

colorMan.setUseStandardWindowsColors <boolean>onOff   

In versions prior to 3ds Max 2010, used to set whether standard windows colors were used or not.

   

<boolean>colorMan.registerColor <string>color <string>name <string>category <point3>defaultColor 

This registers a new color with the system, and adds a color to the color manager database that is then accessible from the color customization UI. It returns false if the color is already registered; otherwise true .

<string>color: The ID of the color to register. Example: #myNewColor

<string>name: The name for the color. Example: "My Own Color"

<string>category: The category for the color. If the name passed matches one of the existing 3ds Max categories the color will be placed in there, otherwise a new one will be created. Example: "Fun Gaming Colors"

<point3>defaultColor: The default value for the color. This is the value that the color will be reset to when a 3ds Max user presses "Reset" in the color customization dialog. Example: [1,0,0]

EXAMPLE

colorMan.registerColor #myNewColor "My Own Color" "Ugly Colors" [1,0,0] 				  

This registers a new color, with the name #myNewColor , with a default value of red. The category in the customization UI will be "Ugly Colors" and the name will be "My Own Color".

In other scripts you can access this color using:

colorMan.getColor #myNewColor	
NOTE: colorMan.registerColor should be called from a script in the \stdplugs\stdscripts folder. These scripts are run when 3ds Max starts, so the color will be available in the customization UI immediately. If the user customizes this color, its value will be saved in the MaxColors.clr file.

   

<boolean>colorMan.loadColorFile <filename>file 

This method will load the specified color file from the current UI directory. Returns true if the load was successful, otherwise false .

<string>file: The filename of the color file to load.

NOTE:The path specified must be relative to the \UI directory.

   

<boolean>colorMan.saveColorFile <filename>file 

This method will save the specified color file from the current UI directory. Returns true if the save process was successful, otherwise false .

<string>file: The filename of the color file to save.

NOTE:The path specified must be relative to the \UI directory.

   

<filename>colorMan.getColorFile() 

Returns the file name of the current color file.

   

<boolean>colorMan.setColor <string>color <point3>colorValue 

Sets the color value of the previously registered color whose ID is passed. Returns true if the color was set and false if the id passed could not be found.

<string>color: Specifies which color to set.

<point3>colorValue: The color value to set.

Predefined colors include:

#background

The background for all controls and buttons

#text

The text for all controls and buttons

#activeCommand

The color command mode buttons turn when pressed

#hilight

The hilight color for 3d controls

#shadow

The shadow color for 3d controls

#window

The background color for edit boxes, list boxes and other windows

#activeCaption

The color of the active caption

#toolTipBackground

The background for viewport tool tips

#toolTipText

The text color for viewport tool tips

#hilightText

The highlight color in the stack view drop-down list

#windowText

The color used in edit boxes, list boxes and other windows

#itemHilight

The item highlight color

#subObjectColor

The color used to highlight sub-object levels in StackView

#3dDarkShadow

the dark shadow color on 3d controls

#3dLight

the light color on 3d controls

#appWorkspace

the application workspace color

#trackbarBg

trackbar background

#trackbarBgSel

trackbar background for selected keys

#trackbarText

trackbar text

#trackbarTicks

trackbar ticks

#trackbarKeys

trackbar keys

#trackbarSelKeys

track bar selected keys

#trackbarCursor

track bar cursor

#pressedButton

background color for pressed buttons, like the transform constraints

#timeSliderBg

The background for the time slider bar.

#viewportBorder

The viewport border color

#activeViewportBorder

The active viewport border color

#rollupTitleFace

Rollout title background

#rollupTitleText

rollout title text

#rollupTitleHilight

rollout title 3d highlight

#rollupTitleShadow

rollout title 3d shadow

#selectionRubberBand

the selection marquee color

#stackViewSelection

the color of a selected item in stack view

   

<color>colorMan.getColor <string>color 

Returns the color value of the color whose ID is passed, or black (RGB(0,0,0)) if the Color passed was not found.

<string>color: Specifies which color to get.

   

<name>colorMan.getName <string>color 

Returns the name of the color whose ID is passed.

<string>color: The ID of the color.

   

<string>colorMan.getCategory <string>color 

Returns the category string of the color whose ID is passed.

<string>color: The ID of the color.

   

<boolean>colorMan.setIconFolder <filename>folder 

<filename>folder - The name of the folder relative to the UI directory. Absolute pathnames are not supported.

This method sets the folder from which all icons for the UI are loaded, and immediately reloads the icons from that folder.

NOTE:

If a folder with no icon files is loaded, all icons in the UI become blank, and no warning is issued.

   

<filename>colorMan.getIconFolder() 

Returns the absolute pathname of the current icon folder. Note that getIconFolder returns an absolute path while setIconFolder accepts only relative paths.

   

<float>colorMan.getIconColorScale <enum>type <enum>which 

type enums: {#disabledIcon|#enabledIcon} 
which enums: {#saturationScale|#valueScale|#alphaScale} 

Returns a floating point value (in the range 0.0 to 1.0) that is one of the scale factors applied to the specified icon type. These scale values used to do image processing on the icons at start-up time.

<enum>type: One of the following values:

#disabledIcon: The disabled icons.

#enabledIcon: The enabled icons.

<enum>which : The icon color scale. One of the following values:

#saturationScale: The saturation scale.

#valueScale: The value scale.

#alphaScale: The alpha scale.

   

colorMan.setIconColorScale <enum>type <enum>which <float>value 

type enums: {#disabledIcon|#enabledIcon} 
which enums: {#saturationScale|#valueScale|#alphaScale} 

Sets the specified scale factor for the icon type passed. The color manager maintains the values for the 3ds Max icon image processing system. Developers can set values to scale the saturation, value and transparency for enabled and disabled icon images using this method.

<enum>type: The icon type. Can be one of the following values:

#disabledIcon: The disabled icons.

#enabledIcon: The enabled icons.

<enum>which: The icon color scale. Can be one of the following values:

#saturationScale: The saturation scale.

#valueScale: The value scale.

#alphaScale: The alpha scale.

<float>value: The value runs from 0.0 to 100.0.

   

colorMan.getIconColorInvert <enum>type 

type enums: {#disabledIcon|#enabledIcon} 

Returns true if the invert flag is set for the specified icon type and false if not set.

<enum>type: The icon type. Can be one of the following values:

#disabledIcon: The disabled icons.

#enabledIcon: The enabled icons.

   

colorMan.setIconColorInvert <enum>type <boolean>value 

type enums: {#disabledIcon|#enabledIcon} 

Sets the invert flag for the specified icon type to on or off .

<enum>type: The icon type. One of the following values:

#disabledIcon: The disabled icons.

#enabledIcon: The enabled icons.

<boolean>value: Pass true for inverted; false for not inverted.

   

<filename>colorMan.getFileName() 

Returns the file name of the currently loaded color file.

NOTE:This filename specifies an absolute path, even though loadColorFile and saveColorFile use relative paths.

   

<color>colorMan.getDefaultColor <string>color 

Returns the default color for the specified ID. The default color is the value passed as defaultValue in registerColor, regardless if a SetColor() has been done subsequently. This is used by the UI when the user presses "Reset" to reset a color to its default value.

<string>color: The ID of the color.

   

colorMan.repaintUI <enum>type 

type enums: {#repaintAll|#repaintTrackBar|#repaintTimeBar} 

This method allows you to issue a repaint of the user interface. This is equivalent to the Apply Colors Now button in the Customize dialog.

<repaintType>type: The type of repaint you wish to issue; #repaintAll , #repaintTrackBar , #repaintTimeBar .

Here is a macroScript that turns the time slider and trackbar backgrounds blue:

EXAMPLE

macroScript BlueBar
category: "Color"
tooltip: "Blue Bar"
(
  on execute do
  (
    colorMan.setColor #timeSliderBg [0, 0, .6]
    colorMan.repaintUI #repaintTimeBar
    colorMan.setColor #trackbarBg [0, 0, .6]
    colorMan.repaintUI #repaintTrackBar
  )
)
NOTE:All of 3ds Max's standard icon BMP files must exist in that folder. If any of the standard files are missing, icons will appear blank in 3ds Max's UI. All the icons files needed live in the UI\Icons folder, which is the default icon folder.

   

colorman.reInitIcons() 

Reloads all CUI icons from the icon files. This can be used to refresh the UI after adding new or editing existing icon bitmap files.

Available in 3ds Max 9 and higher.

   

<bool>colorman.resolveIconFolder <filename> <&fullfilename> 

This method resolves the filename using the user icon path, then the system icon path, and then <3dsmax.exe>\ui\icons.

If the file is found, fully qualified filename is placed in fullfilename and the method returns true.

If not found, the method returns false.

Available in 3ds Max 9 and higher.

See also Class IcolorManager, in the SDK Help file accompanying this product

See Also