Documentation
¶
Index ¶
- Constants
- Variables
- func InitialModel() (model, error)
- type ColorOption
- type ColorSubMode
- type FocusedPanel
- type FontData
- type FontInfo
- type GradientDirection
- type GradientDirectionOption
- type LabelStyles
- type ShadowPixelOption
- type ShadowStyleOption
- type ShadowSubMode
- type SpacingMode
- type TextAlignment
- type TextInputMode
- type TextScale
Constants ¶
const ( MinShadowPixels = -5 MaxShadowPixels = 5 DefaultShadowPixels = 5 // Index for "Off" in shadowPixelOptions MinVerticalShadowPixels = -5 MaxVerticalShadowPixels = 5 )
Shadow pixel range constants
const ( MinCharSpacing = 0 MaxCharSpacing = 10 MinWordSpacing = 0 MaxWordSpacing = 20 MinLineSpacing = 0 MaxLineSpacing = 10 )
Spacing range constants
const ( DefaultCharSpacing = 2 DefaultWordSpacing = 2 DefaultLineSpacing = 1 DefaultTextScale = ScaleOne )
Default values
const ( TextInputCharLimit = 50 TextInputMinWidth = 17 TextInputMaxWidth = 50 FilenameInputCharLimit = 50 FilenameInputWidth = 40 MaxFilenameLength = 200 // Maximum filename length before extension )
Text input constraints
const ( MinWidthSingleRow = 65 ComfortableWidthSingleRow = 80 LayoutReservedMargin = 12 // Fixed margin for borders and spacing LayoutMinPanelWidth = 8 // Absolute minimum panel width LayoutSpacerWidth = 1 // Fixed spacer between panels )
Layout thresholds
const ( MaxRGBValue = 255 // Maximum RGB color value MaxShadowRepeatCount = 20 // Maximum repetition for shadow characters )
Color constants
const (
CursorBlink = 1
)
Cursor mode constants
Variables ¶
var ( ColorWhite = ColorPalette["White"] ColorRed = ColorPalette["PureRed"] ColorTextInput = ColorPalette["TextInput"] ColorExport = ColorPalette["Export"] ColorGray = ColorPalette["FaintGray"] ColorFaint = ColorPalette["VeryFaint"] )
Color variables - now referencing the centralized color palette
var ANSIColorMap = ansifonts.ANSIColorMap
ANSIColorMap provides mappings from ANSI color codes to hex values This references the canonical color map from the ansifonts package
var ColorPalette = map[string]string{
"White": "#FFFFFF",
"Red": "#FF5555",
"Green": "#50FA7B",
"Blue": "#8BE9FD",
"Yellow": "#F1FA8C",
"Magenta": "#FF79C6",
"Cyan": "#8BE9FD",
"Gray": "#6272A4",
"PureRed": "#FF0000",
"TextInput": "#FF6B6B",
"Export": "#4A90E2",
"FaintGray": "#626264",
"VeryFaint": "#626262",
"TitleFG": "#FAFAFA",
"TitleBG": "#7D56F4",
"PanelBorder": "#874BFD",
"Selected": "#F25D94",
"TextDisplay": "#04B575",
"Shadow": "#A0A0A0",
"FontPanel": "#4ECDC4",
"CharSpacing": "#45B7D1",
"WordSpacing": "#96CEB4",
"LineSpacing": "#9B59B6",
"ColorPanel": "#FECA57",
"ScalePanel": "#FF9FF3",
"Black": "#000000",
}
Centralized color palette for consistent color usage across the application
Functions ¶
func InitialModel ¶
func InitialModel() (model, error)
Types ¶
type ColorOption ¶
Color options for text with proper hex codes
func GetANSIColorOptions ¶
func GetANSIColorOptions() []ColorOption
GetANSIColorOptions returns a comprehensive list of color options specifically for text rendering, sourced from standard ANSI colors
type ColorSubMode ¶
type ColorSubMode int
Color sub-modes for the color panel
const ( TextColorMode ColorSubMode = iota GradientColorMode GradientDirectionMode TotalColorSubModes )
type FocusedPanel ¶
type FocusedPanel int
Panel identifiers using iota for type safety
const ( TextInputPanel FocusedPanel = iota FontPanel SpacingPanel ColorPanel ScalePanel ShadowPanel TotalPanels // Used for modulo operations )
type FontData ¶
type FontData struct {
Name string `json:"name"`
Author string `json:"author"`
License string `json:"license"`
Characters map[string][]string `json:"characters"`
}
FontData represents the overall structure of our .bit font file (JSON format)
type FontInfo ¶
type FontInfo struct {
Name string
Path string
FontData *FontData // Pointer to allow for lazy loading (nil when not loaded)
Loaded bool // Flag to indicate if font data is loaded
}
FontInfo holds information about available fonts
type GradientDirection ¶
type GradientDirection int
Gradient direction indices
const ( GradientUpDown GradientDirection = iota GradientDownUp GradientLeftRight GradientRightLeft TotalGradientDirections )
type GradientDirectionOption ¶
type GradientDirectionOption struct {
Name string
}
Gradient direction options
type LabelStyles ¶
type LabelStyles struct {
TextInput lipgloss.Style
Font lipgloss.Style
CharSpacing lipgloss.Style
WordSpacing lipgloss.Style
LineSpacing lipgloss.Style
Color lipgloss.Style
Scale lipgloss.Style
}
LabelStyles holds all label styles for different panel types
type ShadowPixelOption ¶
Shadow pixel options for shadow extension
type ShadowStyleOption ¶
Shadow style options using ANSI block characters
type ShadowSubMode ¶
type ShadowSubMode int
Shadow sub-modes for the shadow panel
const ( HorizontalShadowMode ShadowSubMode = iota VerticalShadowMode ShadowStyleMode TotalShadowSubModes )
type SpacingMode ¶
type SpacingMode int
Spacing modes for the spacing panel
const ( CharacterSpacingMode SpacingMode = iota WordSpacingMode LineSpacingMode TotalSpacingModes )
type TextAlignment ¶
type TextAlignment int
Text alignment options
const ( LeftAlignment TextAlignment = iota CenterAlignment RightAlignment TotalAlignments )
type TextInputMode ¶
type TextInputMode int
Text input modes for the text input panel
const ( TextEntryMode TextInputMode = iota TextAlignmentMode TotalTextInputModes )