Pote.Validator.HSL (Pote v3.0.0)

Copy Markdown View Source

HSL and HSV color string validation.

Splits out HSL/HSV-specific validation from Pote.Validator.

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

Summary

Functions

Returns error messages for HSL/HSV validation errors.

Validates an HSL color code: H,S,L (H: 0-360 degrees, S/L: 0-100%).

Validates an HSV color code: H,S,V (H: 0-360 degrees, S/V: 0-100%).

Functions

error_message(atom)

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

Returns error messages for HSL/HSV validation errors.

validate(code)

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

Validates an HSL color code: H,S,L (H: 0-360 degrees, S/L: 0-100%).

validate_hsv(code)

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

Validates an HSV color code: H,S,V (H: 0-360 degrees, S/V: 0-100%).