Pote.Orchestrator.Parser (Pote v3.0.0)

Copy Markdown View Source

Parses color inputs from various formats into normalized RGB tuples.

This module handles all color parsing, including string prefixes (rgb:, hsl:, hsv:, cmyk:, hwb:, hex:, xterm:, theme:), raw tuples, integers, atoms, and named colors.

Summary

Functions

Parses a color from various input formats.

Functions

parse_color(input)

@spec parse_color(Pote.color_input()) :: {:ok, Pote.rgb()} | {:error, String.t()}

Parses a color from various input formats.

Parameters

  • input - Color in any supported format

Returns

  • {:ok, rgb} - RGB tuple on success
  • {:error, message} - Error string with explanation