Documentation
¶
Index ¶
- Constants
- func ValidateHex(s string) (string, bool)
- func ValidateRGBValue(s string) (uint8, bool)
- type ColorInput
- type InputType
- type Palette
- func (p *Palette) CurrentColor() colorful.Color
- func (p *Palette) GetSize() (int, int)
- func (p *Palette) Height() int
- func (p *Palette) SetHistory(hexColors []string)
- func (p *Palette) SetSize(width, height int)
- func (p *Palette) Update(msg tea.Msg) (colorful.Color, bool)
- func (p *Palette) View() string
- func (p *Palette) Width() int
- type PaletteMode
- type Preview
- type Slider
Constants ¶
View Source
const ( TrueColorCols = 60 TrueColorRows = 16 GrayscaleCols = 60 DefaultWidth = TrueColorCols * 2 // 120 chars (largest mode) DefaultHeight = TrueColorRows + 2 // 18 lines (title + spacing + 16 rows) MinPaletteWidth = 20 // 10 columns × 2 chars MinPaletteHeight = 6 )
View Source
const ( MinSliderWidth = 10 // Minimum bar width DefaultSliderWidth = 28 // Default bar width MaxSliderWidth = 32 // Maximum bar width )
Variables ¶
This section is empty.
Functions ¶
func ValidateHex ¶
ValidateHex validates and normalizes a hex color string
func ValidateRGBValue ¶
ValidateRGBValue validates an RGB component value (0-255)
Types ¶
type ColorInput ¶
type ColorInput struct {
Type InputType
Label string
Focused bool
// contains filtered or unexported fields
}
ColorInput represents a color value input field
func NewColorInput ¶
func NewColorInput(inputType InputType, label string, width int) *ColorInput
NewColorInput creates a new color input
func (*ColorInput) SetValue ¶
func (c *ColorInput) SetValue(value string)
SetValue sets the input value
func (*ColorInput) Update ¶
func (c *ColorInput) Update(msg tea.Msg) (*ColorInput, tea.Cmd)
Update handles input messages
type Palette ¶
type Palette struct {
TrueColors []colorful.Color
Colors256 []colorful.Color
BasicColors []colorful.Color
Grayscale []colorful.Color
Solarized []colorful.Color
Dracula []colorful.Color
Nord []colorful.Color
Gruvbox []colorful.Color
Monokai []colorful.Color
Catppuccin []colorful.Color
TokyoNight []colorful.Color
Tailwind []colorful.Color
Material []colorful.Color
History []colorful.Color
Cursor int
Columns int
Focused bool
Mode PaletteMode
// contains filtered or unexported fields
}
Palette represents the color palette component
func NewPalette ¶
func NewPalette() *Palette
NewPalette creates a new palette with auto-detected color support
func (*Palette) CurrentColor ¶
CurrentColor returns the selected color
func (*Palette) SetHistory ¶
SetHistory updates history colors
type PaletteMode ¶
type PaletteMode int
PaletteMode represents display mode
const ( PaletteModeTrueColor PaletteMode = iota // True color gradient PaletteMode256 // 256 terminal colors PaletteModeBasic // 16 ANSI colors PaletteModeGrayscale // Grayscale PaletteModeSolarized // Solarized PaletteModeDracula // Dracula PaletteModeNord // Nord PaletteModeGruvbox // Gruvbox PaletteModeMonokai // Monokai PaletteModeCatppuccin // Catppuccin PaletteModeTokyoNight // Tokyo Night PaletteModeTailwind // Tailwind CSS PaletteModeMaterial // Material Design PaletteModeHistory // History (last) )
type Preview ¶
Preview represents the color preview component
Click to show internal directories.
Click to hide internal directories.