Documentation
¶
Overview ¶
Package input provides the interface and base types for input plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlagHelp ¶
FlagHelp is a type alias to protocol.FlagHelp for backward compatibility. Internal plugins can use input.FlagHelp, while external plugins should use protocol.FlagHelp.
type GenerateOptions ¶
type GenerateOptions struct {
// Verbose enables verbose output.
Verbose bool
// DryRun generates output without side effects.
DryRun bool
// Backend is the colour extraction backend to use.
Backend string
// ColourOverrides are manual colour specifications (role=hex).
ColourOverrides []string
// PluginArgs are custom arguments for this plugin.
PluginArgs map[string]any
}
GenerateOptions holds options passed to input plugins during generation.
type GenerateResult ¶
type GenerateResult struct {
// Palette is the generated colour palette.
Palette *colour.Palette
// WallpaperPath is the optional path to the source wallpaper image.
// This is used when --set-wallpaper flag is enabled.
WallpaperPath string
}
GenerateResult holds the result of input plugin generation.
type Plugin ¶
type Plugin interface {
// Name returns the plugin's name (e.g., "image", "file").
Name() string
// Description returns a human-readable description of the plugin.
Description() string
// Version returns the plugin version (e.g., "1.0.0").
Version() string
// Generate creates a raw Palette from plugin-specific inputs.
// opts contains flags and arguments passed from the CLI.
// Returns a simple list of colors - categorization happens separately.
Generate(ctx context.Context, opts GenerateOptions) (*colour.Palette, error)
// RegisterFlags registers plugin-specific flags with cobra command.
RegisterFlags(cmd *cobra.Command)
// Validate checks if the plugin has all required inputs configured.
Validate() error
// GetFlagHelp returns help information for plugin-specific flags.
// This allows dynamic help generation based on selected plugins.
GetFlagHelp() []FlagHelp
}
Plugin represents an input plugin that generates a colour palette.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered input plugins.
type ThemeHinter ¶
type ThemeHinter interface {
// ThemeHint returns a suggested theme type based on the plugin's analysis.
// Returns one of: "auto", "dark", "light", or "" for no hint.
ThemeHint() string
}
ThemeHinter is an optional interface that input plugins can implement. to provide hints about theme detection to the categorizer. This is purely advisory - the categorizer makes the final decision.
type WallpaperProvider ¶
type WallpaperProvider interface {
// WallpaperPath returns the canonical path to the source wallpaper image.
// This path is resolved to be usable from any working directory:
// - Relative paths are converted to absolute paths
// - Tilde-prefixed paths (~/...) are preserved for portability
// - URLs are returned as-is
// Returns empty string if no wallpaper is available.
WallpaperPath() string
// WallpaperRawPath returns the literal path as provided by the user.
// This is the unmodified input before any path canonicalization.
// Returns empty string if no wallpaper is available.
WallpaperRawPath() string
}
WallpaperProvider is an optional interface that input plugins can implement. to provide the source wallpaper path. This is used with the --set-wallpaper flag to allow output plugins to set the wallpaper alongside the generated themes.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package file provides an input plugin for loading colour palettes from files or manual specifications.
|
Package file provides an input plugin for loading colour palettes from files or manual specifications. |
|
Package googlegenai provides an input plugin for generating images using Google's Imagen models.
|
Package googlegenai provides an input plugin for generating images using Google's Imagen models. |
|
Package image provides an input plugin for extracting colour palettes from images.
|
Package image provides an input plugin for extracting colour palettes from images. |
|
Package markdown provides an input plugin for loading themes from markdown theme files.
|
Package markdown provides an input plugin for loading themes from markdown theme files. |
|
Package openrouter provides an input plugin for generating images using OpenRouter.ai models.
|
Package openrouter provides an input plugin for generating images using OpenRouter.ai models. |
|
Package remotecss provides an input plugin for fetching colour palettes from remote CSS sources.
|
Package remotecss provides an input plugin for fetching colour palettes from remote CSS sources. |
|
Package remotejson provides an input plugin for fetching colour palettes from remote JSON sources with JSONPath queries.
|
Package remotejson provides an input plugin for fetching colour palettes from remote JSON sources with JSONPath queries. |
|
shared
|
|
|
aiflags
Package aiflags provides shared flags for AI image generation plugins.
|
Package aiflags provides shared flags for AI image generation plugins. |
|
commonflags
Package commonflags provides shared unprefixed flags for input plugins.
|
Package commonflags provides shared unprefixed flags for input plugins. |
|
imagecolours
Package imagecolours provides shared helpers for extracting colour palettes from images and saving generation metadata.
|
Package imagecolours provides shared helpers for extracting colour palettes from images and saving generation metadata. |
|
palettebuilder
Package palettebuilder provides shared helpers for building colour palettes from map[string]string colour sources with optional role-mapping support.
|
Package palettebuilder provides shared helpers for building colour palettes from map[string]string colour sources with optional role-mapping support. |
|
regions
Package regions provides utilities for extracting colors from specific.
|
Package regions provides utilities for extracting colors from specific. |
|
seed
Package seed provides utilities for deterministic seed generation for k-means clustering.
|
Package seed provides utilities for deterministic seed generation for k-means clustering. |