Srgb

data class Srgb(r: Double, g: Double, b: Double) : Rgb

A color in the standard sRGB color space. This is the most common device color space, usually used for final output colors.

See also

Constructors

Srgb
Link copied to clipboard
fun Srgb(r: Int, g: Int, b: Int)

Create a color from 8-bit integer sRGB components.

Srgb
Link copied to clipboard
fun Srgb(color: Int)

Create a color from a packed (A)RGB8 integer.

Srgb
Link copied to clipboard
fun Srgb(color: String)

Create a color from a hex color code (e.g. #FA00FA). Hex codes with and without leading hash (#) symbols are supported.

Srgb
Link copied to clipboard
fun Srgb(r: Double, g: Double, b: Double)

Functions

toHex
Link copied to clipboard
fun toHex(): String

Convert this color to an 8-bit hex color code (e.g. #FA00FA).

toRgb8
Link copied to clipboard
fun toRgb8(): Int

Convert this color to an 8-bit packed RGB integer (32 bits total)

Properties

b
Link copied to clipboard
open override val b: Double

Blue color component.

g
Link copied to clipboard
open override val g: Double

Green color component.

r
Link copied to clipboard
open override val r: Double

Red color component.

Extensions

toLinear
Link copied to clipboard
@JvmName(name = "fromSrgb")
fun Srgb.toLinear(): LinearSrgb

Convert this color to linear sRGB. This linearizes the sRGB components.