Pote.Validator.RGB (Pote v3.0.0)

Copy Markdown View Source

RGB and ARGB color string validation.

Splits out the RGB/ARGB-specific validation from Pote.Validator.

Not part of the public API — used only by Pote.Validator.

Summary

Functions

Returns error messages for RGB/ARGB validation errors.

Validates an RGB color code: R,G,B (3 values 0-255).

Validates an ARGB color code: A,R,G,B (4 values 0-255).

Functions

error_message(atom)

@spec error_message(atom()) :: String.t()

Returns error messages for RGB/ARGB validation errors.

validate(code)

@spec validate(String.t()) :: :ok | {:error, atom()}

Validates an RGB color code: R,G,B (3 values 0-255).

validate_argb(code)

@spec validate_argb(String.t()) :: :ok | {:error, atom()}

Validates an ARGB color code: A,R,G,B (4 values 0-255).