palettebuilder

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package palettebuilder provides shared helpers for building colour palettes from map[string]string colour sources with optional role-mapping support. Used by remotecss and remotejson input plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPalette

func BuildPalette(colors, mapping map[string]string, verbose bool) (*colour.Palette, error)

BuildPalette converts a map of colour names → hex strings into a Palette. If mapping is non-empty, role hints are applied: each entry maps a source colour name to a colour.Role string. When verbose is true, missing source keys are reported as warnings.

func ParseColourRole

func ParseColourRole(name string) (colour.Role, error)

ParseColourRole parses a role name string into a Role constant. The name is normalised to lowercase with underscores and hyphens stripped.

func ParseHex

func ParseHex(hex string) (colour.RGB, error)

ParseHex parses a hex colour string into an RGB struct. Supports formats: #RRGGBB, RRGGBB, #RGB, RGB.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL