ColorUtils

object ColorUtils

Utility functions for color conversion.

Functions

Link copied to clipboard
fun colorToHex(color: Color, includeAlpha: Boolean = false): String

Converts a Color to a hex string (#RRGGBB or #AARRGGBB).

Link copied to clipboard
fun colorToHsv(color: Color): FloatArray
Link copied to clipboard
fun hexToColor(hex: String): Color?

Parses a hex string to a Color. Supports formats: #RRGGBB, #AARRGGBB. Returns null if the format is invalid.

Link copied to clipboard
fun hsvToColor(hue: Float, saturation: Float, value: Float, alpha: Float): Color