ui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinShadowPixels         = -5
	MaxShadowPixels         = 5
	DefaultShadowPixels     = 5 // Index for "Off" in shadowPixelOptions
	MinVerticalShadowPixels = -5
	MaxVerticalShadowPixels = 5
)

Shadow pixel range constants

View Source
const (
	MinCharSpacing = 0
	MaxCharSpacing = 10
	MinWordSpacing = 0
	MaxWordSpacing = 20
	MinLineSpacing = 0
	MaxLineSpacing = 10
)

Spacing range constants

View Source
const (
	DefaultCharSpacing = 2
	DefaultWordSpacing = 2
	DefaultLineSpacing = 1
	DefaultTextScale   = ScaleOne
)

Default values

View Source
const (
	TextInputCharLimit     = 50
	TextInputMinWidth      = 17
	TextInputMaxWidth      = 50
	FilenameInputCharLimit = 50
	FilenameInputWidth     = 40
	MaxFilenameLength      = 200 // Maximum filename length before extension
)

Text input constraints

View Source
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

View Source
const (
	MaxRGBValue          = 255 // Maximum RGB color value
	MaxShadowRepeatCount = 20  // Maximum repetition for shadow characters
)

Color constants

View Source
const (
	CursorBlink = 1
)

Cursor mode constants

Variables

View Source
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

View Source
var ANSIColorMap = ansifonts.ANSIColorMap

ANSIColorMap provides mappings from ANSI color codes to hex values This references the canonical color map from the ansifonts package

View Source
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

type ColorOption struct {
	Name string
	Hex  string
}

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

type ShadowPixelOption struct {
	Name   string
	Pixels int
}

Shadow pixel options for shadow extension

type ShadowStyleOption

type ShadowStyleOption struct {
	Name string
	Char rune
	Hex  string
}

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
)

type TextScale

type TextScale int

Text scale options

const (
	ScaleHalf TextScale = -1 // 0.5x
	ScaleOne  TextScale = 0  // 1x
	ScaleTwo  TextScale = 1  // 2x
	ScaleFour TextScale = 2  // 4x
	MinScale            = ScaleHalf
	MaxScale            = ScaleFour
)

Jump to

Keyboard shortcuts

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