toHex

fun Color.toHex(includePrefix: Boolean = true, prefix: String = "#", alwaysIncludeAlpha: Boolean = false): String

Convert the color to a hex string.

Receiver

Color to convert.

Return

String hex representation of the color.

Parameters

includePrefix

whether to include the '#' prefix.