-
Notifications
You must be signed in to change notification settings - Fork 4
Color
A rainbow of predefined colors as well as a few color modification functions. These all use a custom ColorMixin when manipulating colors. Contains predefined colors as well as a few methods to create or modify colors.
Aurora also provides an implementation of CUSTOM_CLASS_COLORS.
Create a new color object with the given color values. If an alpha value is not
provided, it defaults to 1 or FF.
Args:
-
r- red value between 0 and 1 (number) -
g- green value between 0 and 1 (number) -
b- blue value between 0 and 1 (number) -
a- optional alpha value between 0 and 1 (number)
OR
-
hexColor- hexadecimal digets in the format RRGGBB or AARRGGBB (string)
Returns:
-
color- a new color object (ColorMixin)
Create a new color where its hue is offset by a percentage from the hue
of the given color. color can be a ColorMixin or a table with r,
g, and b keys.
Args:
-
color- the color to be modified (ColorMixin) -
delta- a decimal from -1 to 1 where 0 confers no change (number)
Returns:
-
color- a new color object (ColorMixin)
Create a new color where its saturation is offset by a percentage from
the saturation of the given color. color can be a ColorMixin or a
table with r, g, and b keys.
Args:
-
color- the color to be modified (ColorMixin) -
delta- a decimal from -1 to 1 where 0 confers no change (number)
Returns:
-
color- a new color object (ColorMixin)
Create a new color where its lightness is offset by a percentage from
the lightness of the given color. color can be a ColorMixin or a
table with r, g, and b keys.
Args:
-
color- the color to be modified (ColorMixin) -
delta- a decimal from -1 to 1 where 0 confers no change (number)
Returns:
-
color- a new color object (ColorMixin)
A range of predetermined colors are also available. The values listed are in red, green, blue order.
-
Color.red- 0.8, 0.2, 0.2 -
Color.orange- 0.8, 0.5, 0.2 -
Color.yellow- 0.8, 0.8, 0.2 -
Color.lime- 0.5, 0.8, 0.2 -
Color.green- 0.2, 0.8, 0.2 -
Color.jade- 0.2, 0.8, 0.5 -
Color.cyan- 0.2, 0.8, 0.8 -
Color.marine- 0.2, 0.5, 0.8 -
Color.blue- 0.2, 0.2, 0.8 -
Color.violet- 0.5, 0.2, 0.8 -
Color.magenta- 0.8, 0.2, 0.8 -
Color.ruby- 0.8, 0.2, 0.5 -
Color.black- 0, 0, 0 -
Color.grayDark- 0.25, 0.25, 0.25 -
Color.gray- 0.5, 0.5, 0.5 -
Color.grayLight- 0.75, 0.75, 0.75 -
Color.white- 1, 1, 1
These colors are used extensively in the UI skins.
-
Color.highlight- defaults to the player's class color -
Color.button- defaults toColor.grayDark -
Color.frame- defaults toColor.black -
Color.border- defaults to 0.15, 0.15, 0.15 — UI element borders
Named palette presets for the color mode system. Each entry defines:
- tokens: replacement values for the neutral Color.* palette tokens
- highlightBoost: optional descriptor applied transiently in Color.GetHighlightColor()
Adding a new mode requires only a new table entry — no code changes elsewhere.
Returns the name of the currently active color mode.
Returns:
-
name- the active mode name (string)
Switch the active color mode. Applies the named mode's palette tokens
to the live Color.* objects, updates activeMode and
AuroraConfig.colorMode, broadcasts to all registered elements, and
dispatches a CONFIG_CHANGED event.
No-op if name is already the active mode or is not a valid mode name.
Args:
-
name- a key inColor.Modes(string)
Temporarily apply the named mode's palette tokens and highlight boost
to all registered UI elements via Color.PreviewHighlightColor. Does
not persist the change to activeMode or AuroraConfig.colorMode.
Used by the RealUI display wizard preview frame to show how a mode looks before it is confirmed.
Args:
-
name- a key inColor.Modes(string)