Raxol.Style.Colors.PaletteManager (Raxol v2.0.1)

View Source

Manages color palette generation and scale creation with accessibility considerations.

Summary

Functions

Generates a color scale from a base color with the specified number of steps. Ensures each color in the scale has sufficient contrast with dark backgrounds.

Functions

generate_scale(base_color, steps)

@spec generate_scale(String.t(), pos_integer()) :: [String.t()]

Generates a color scale from a base color with the specified number of steps. Ensures each color in the scale has sufficient contrast with dark backgrounds.

Parameters

  • base_color - The base hex color (e.g., "#0077CC")
  • steps - Number of colors in the scale

Returns

List of hex color strings with sufficient contrast ratios