Color

A standard colour in RGB format, with a red, green, and blue component.

Parameters

red

the red component

green

the green component

blue

the blue component

Constructors

Link copied to clipboard
constructor(red: Int, green: Int, blue: Int)
constructor(value: Int)
Creates a new colour from the given encoded RGB value.

Functions

Link copied to clipboard
open fun asHSV(): @NotNull HSVLike
Link copied to clipboard
abstract fun blue(): Int
Link copied to clipboard
open fun encode(): Int
Gets this colour in encoded RGB form.
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
@NotNull
open fun fromHsv(@NotNull hsv: @NotNull HSVLike): @NotNull Color
Creates a new colour from the given hsv colour.
@NotNull
open fun fromHsv(hue: Float, saturation: Float, value: Float): @NotNull Color
Creates a new colour from the given hue, saturation, and value components.
Link copied to clipboard
abstract fun green(): Int
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun red(): Int
Link copied to clipboard
abstract fun toString(): String
Link copied to clipboard
@NotNull
open fun withBlue(blue: Int): @NotNull Color
Creates a new colour with the given new [blue] value.
Link copied to clipboard
@NotNull
open fun withGreen(green: Int): @NotNull Color
Creates a new colour with the given new [green] value.
Link copied to clipboard
@NotNull
open fun withRed(red: Int): @NotNull Color
Creates a new colour with the given new [red] value.

Properties

Link copied to clipboard
@NotNull
val BLACK: @NotNull Color
Link copied to clipboard
@NotNull
val BLUE: @NotNull Color
Link copied to clipboard
@NotNull
val CYAN: @NotNull Color
Link copied to clipboard
@NotNull
val GRAY: @NotNull Color
Link copied to clipboard
@NotNull
val GREEN: @NotNull Color
Link copied to clipboard
@NotNull
val MAGENTA: @NotNull Color
Link copied to clipboard
@NotNull
val RED: @NotNull Color
Link copied to clipboard
@NotNull
val WHITE: @NotNull Color
Link copied to clipboard
@NotNull
val YELLOW: @NotNull Color