Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorBlock ¶
ColorBlock wraps a block with arbitrary color attributes for gohcl decoding.
type LightnessTransform ¶
LightnessTransform holds the parsed transform lightness configuration.
func ParseTransformBlock ¶
func ParseTransformBlock(body *hclsyntax.Body) (*LightnessTransform, error)
ParseTransformBlock extracts and parses a transform { lightness { ... } } block from an *hclsyntax.Body. Returns (nil, nil) if no transform block is present.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader handles two-pass HCL decoding with palette resolution.
func (*Loader) Context ¶
func (l *Loader) Context() *hcl.EvalContext
Context returns the EvalContext for manual parsing.
type Meta ¶
type Meta struct {
Name string `hcl:"name,optional"`
Author string `hcl:"author,optional"`
Appearance string `hcl:"appearance,optional"`
URL string `hcl:"url,optional"`
}
Meta holds theme metadata.
type PaletteBlock ¶
PaletteBlock wraps a single palette block for gohcl decoding.
type ParseResult ¶
type ParseResult struct {
Meta Meta
Palette *color.Node
Syntax color.Tree
Theme map[string]color.Color
ANSI map[string]color.Color
}
ParseResult holds the raw parsed theme data.
func Parse ¶
func Parse(path string) (*ParseResult, error)
Parse parses an HCL theme file and returns a fully-resolved ParseResult.
type RawConfig ¶
type RawConfig struct {
Palette *PaletteBlock `hcl:"palette,block"`
Remain hcl.Body `hcl:",remain"`
}
RawConfig captures the palette block first (no EvalContext needed).
type ResolvedConfig ¶
type ResolvedConfig struct {
Meta *Meta `hcl:"meta,block"`
Theme *ColorBlock `hcl:"theme,block"`
ANSI *ColorBlock `hcl:"ansi,block"`
Remain hcl.Body `hcl:",remain"` // captures syntax for manual parsing
}
ResolvedConfig decodes blocks that reference palette.