Color

class Color(val red: UByte, val green: UByte, val blue: UByte, val opacity: Float = 1.0f)

Represents an RGBA color.

Constructors

Link copied to clipboard
constructor(hex: UInt, opacity: Float = 1.0f)

Creates a new Color using the hex representation.

constructor(red: UByte, green: UByte, blue: UByte, opacity: Float = 1.0f)

creates a Color

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val blue: UByte

component

Link copied to clipboard

component

Link copied to clipboard

Hex string representation of this Color

Link copied to clipboard

the inversion of this Color

Link copied to clipboard
val opacity: Float = 1.0f

of the color

Link copied to clipboard
val red: UByte

component

Link copied to clipboard

true if opacity 0

Inherited properties

Link copied to clipboard

Creates a new ColorPaint from the given Color.

Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String

Inherited functions

Link copied to clipboard
fun Color.darker(percent: Float = 0.5f): Color

Makes this Color darker by the given percent.

Link copied to clipboard
Link copied to clipboard
operator fun Color?.invoke(target: Target = Foreground, text: () -> StyledText): StyledText
operator fun Color?.invoke(text: String, target: Target = Foreground): StyledText
Link copied to clipboard
fun Color.lighter(percent: Float = 0.5f): Color

Makes this Color lighter by the given percent.

Link copied to clipboard
infix fun Color.opacity(value: Float): Color

Creates a new Color like this one except with the given opacity.