Companion¶
object Companion
Properties¶
BLACK¶
BLUE¶
CYAN¶
DARK_GRAY¶
GRAY¶
GREEN¶
LIGHT_BLUE¶
val LIGHT_BLUE: KColor
LIGHT_GRAY¶
val LIGHT_GRAY: KColor
MAGENTA¶
ORANGE¶
PINK¶
RED¶
WHITE¶
YELLOW¶
Functions¶
ofArgb¶
Creates a KColor from a packed ARGB Long in the form 0xAARRGGBB.
Parameters
- argb: The packed ARGB value.
ofDye¶
ofFormatting¶
fun ofFormatting(formatting: ChatFormatting): KColor
Creates a KColor from the colour associated with a ChatFormatting constant.
Parameters
- formatting: A ChatFormatting value with an associated colour.
ofHsv¶
Creates a KColor from HSV (Hue, Saturation, Value) components with full opacity.
Parameters
-
hue: Hue in the range 0, 1.
-
saturation: Saturation in the range 0, 1.
-
value: Value (brightness) in the range 0, 1.
Creates a KColor from HSV components with a custom alpha.
Parameters
-
hue: Hue in the range 0, 1.
-
saturation: Saturation in the range 0, 1.
-
value: Value (brightness) in the range 0, 1.
-
alpha: Alpha in the range 0, 1 (0 = fully transparent, 1 = opaque).
ofRgb¶
Creates an opaque KColor from a packed RGB Int in the form 0xRRGGBB.
Parameters
- rgb: The packed RGB value (alpha is set to 255).
random¶
Generates a random KColor.
Parameters
- alpha: Whether the alpha channel should also be randomized. When
falsethe colour is fully opaque.