-
Notifications
You must be signed in to change notification settings - Fork 3
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