Color

data class Color(val r: ERROR CLASS: Symbol not found for UByte, val g: ERROR CLASS: Symbol not found for UByte, val b: ERROR CLASS: Symbol not found for UByte, val a: ERROR CLASS: Symbol not found for UByte = 255.toUByte())

Represents a color with red, green, blue, and alpha components.

Constructors

Link copied to clipboard
constructor(r: ERROR CLASS: Symbol not found for UByte, g: ERROR CLASS: Symbol not found for UByte, b: ERROR CLASS: Symbol not found for UByte, a: ERROR CLASS: Symbol not found for UByte = 255.toUByte())
constructor(raw: ERROR CLASS: Symbol not found for raylib.internal.Color)

Creates a Color instance from a raw raylib Color structure.

constructor(raw: ERROR CLASS: Symbol not found for CValue<ERROR CLASS: Symbol not found for raylib.internal.Color>)

Creates a Color instance from a raw raylib Color CValue.

constructor(r: Int, g: Int, b: Int, a: Int = 255)

Creates a Color instance from integer values for red, green, blue, and alpha components.

constructor(argb: Int)

Creates a Color instance from a single integer representing an ARGB color.

constructor(argb: Long)

Creates a Color instance from a single long integer representing an ARGB color.

constructor(hex: String)

Creates a Color instance from a hexadecimal color string. The string should be in the format "#RRGGBB" or "#RRGGBBAA". The hashtag is required.

constructor(hue: Float, saturation: Float, value: Float)

Creates a Color instance from HSV (Hue, Saturation, Value) components.

constructor(r: Float, g: Float, b: Float, a: Float = 1.0f)

Creates a Color instance from float values for red, green, blue, and alpha components. Each component should be in the range 0.0 to 1.0.

constructor(r: Double, g: Double, b: Double, a: Double = 1.0)

Creates a Color instance from double values for red, green, blue, and alpha components. Each component should be in the range 0.0 to 1.0.

Types

Link copied to clipboard
object Companion

Predefined color constants.

Properties

Link copied to clipboard
val a: ERROR CLASS: Symbol not found for UByte

The alpha component (0-255).

Link copied to clipboard
val argb: Long

The color as an ARGB long.

Link copied to clipboard
val b: ERROR CLASS: Symbol not found for UByte

The blue component (0-255).

Link copied to clipboard
val g: ERROR CLASS: Symbol not found for UByte

The green component (0-255).

Link copied to clipboard

The color as a hexadecimal string in RGB format.

Link copied to clipboard

The color as a hexadecimal string in ARGB format.

Link copied to clipboard
val r: ERROR CLASS: Symbol not found for UByte

The red component (0-255).

Link copied to clipboard
val rgb: Int

The color as an RGB integer. This explicitly does not include the alpha component.

Link copied to clipboard
val rgba: Long

The color as an RGBA long.

Functions

Link copied to clipboard
fun brightness(factor: Float): Color

Applies brightness to this color between a factor of 0.0 and 1.0.

Link copied to clipboard
fun contrast(factor: Float): Color

Applies contrast to this color between a factor of 0.0 and 1.0.

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
fun lerp(other: Color, factor: Float): Color

Creates a linear interpolated color between this color and another color.

Link copied to clipboard
fun tint(other: Color): Color

Takes this color and tints it with another color.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun transparent(factor: Float): Color

Returns a new Color instance with the alpha component adjusted by the specified factor.