ColorSerializer

object ColorSerializer : KSerializer<ContentColor>

Serializes color Int values from/to hex format "#RRGGBB"

Properties

Link copied to clipboard
const val BASE: Int = 16

The numeric base for hex color values (16 for hexadecimal).

Link copied to clipboard
open override val descriptor: SerialDescriptor

The serial descriptor for color values, represented as strings.

Link copied to clipboard
const val PREFIX: Char = '#'

The prefix character for hex color strings.

Link copied to clipboard
const val SUPPORTED_DIGITS: Int = 6

The number of hex digits supported (6 for RGB without alpha).

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): ContentColor

Deserializes a color value from its hex string representation.

Link copied to clipboard
open override fun serialize(encoder: Encoder, value: ContentColor)

Serializes a color value to its hex string representation.