-
public class Color.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static Color.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final ColorfromHex(String hex)Creates a new RGB colour from the hex string providedThis can optionally be prefixed with the character '#' final ColorfromRGB(RGB rgb)Creates a new RGB colour from the rgb value provided by converting the rgb value to an integer final ColorfromRGB(Integer red, Integer green, Integer blue)Creates a new RGB colour from the red, green and blue values provided by converting them to a single RGB integer final ColorfromRGB(Float red, Float green, Float blue)Creates a new RGB colour from the red, green and blue values provided by converting them to RGB integers, then converting those integers to a single RGB integer final ColorfromInt(Integer value)Attempts to get a NamedColor with the specified RGB value, or else creates a new RGB colour from the value provided final Colorrandom(Random random)Randomly generates an RGB colour from the given random generator (defaults to Random.Default) -
-
Method Detail
-
fromHex
final Color fromHex(String hex)
Creates a new RGB colour from the hex string provided
This can optionally be prefixed with the character '#'
-
fromRGB
final Color fromRGB(RGB rgb)
Creates a new RGB colour from the rgb value provided by converting the rgb value to an integer
-
fromRGB
final Color fromRGB(Integer red, Integer green, Integer blue)
Creates a new RGB colour from the red, green and blue values provided by converting them to a single RGB integer
-
fromRGB
final Color fromRGB(Float red, Float green, Float blue)
Creates a new RGB colour from the red, green and blue values provided by converting them to RGB integers, then converting those integers to a single RGB integer
-
fromInt
final Color fromInt(Integer value)
Attempts to get a NamedColor with the specified RGB value, or else creates a new RGB colour from the value provided
-
random
final Color random(Random random)
Randomly generates an RGB colour from the given random generator (defaults to Random.Default)
-
-
-
-