Documentation
¶
Overview ¶
This module contains colors from github.com/charmbracelet/x/exp/charmtone
See: https://github.com/charmbracelet/x/blob/main/exp/charmtone/charmtone.go
Index ¶
- Constants
- Variables
- func FormatPriorityIndicator(priority string) string
- func FormatPriorityWithText(priority string) string
- func FormatStatusIndicator(status string) string
- func FormatStatusWithText(status string) string
- func FormatTaskPriority(task *models.Task) string
- func FormatTaskStatus(task *models.Task) string
- func GetAllPriorityPatterns() map[string]string
- func GetAllPrioritySymbols() map[string]string
- func GetAllStatusSymbols() map[string]string
- func GetPriorityDescription(priority string) string
- func GetPriorityDisplayType(priority string) string
- func GetPriorityPattern(priority string) string
- func GetPriorityStyle(priority string) lipgloss.Style
- func GetPrioritySymbol(priority string) string
- func GetStatusDescription(status string) string
- func GetStatusStyle(status string) lipgloss.Style
- func GetStatusSymbol(status string) string
- func IsValidStatusTransition(from, to string) bool
- func PriorityLegend() string
- func StatusLegend() string
- type BookList
- type BookListOptions
- type Key
- type Logo
- type NoteList
- type NoteListOptions
- type Palette
- type ProjectList
- type ProjectListOptions
- type ProjectRepository
- type TagList
- type TagListOptions
- type TagRepository
- type TaskEditOptions
- type TaskEditor
- type TaskList
- type TaskListOptions
- type TaskRepository
- type TaskView
- type TaskViewOptions
Constants ¶
const ( // U+25CF Black Circle StatusTodoSymbol = "●" // U+25D0 Circle with Left Half Black StatusInProgressSymbol = "◐" // U+25A0 Black Square StatusBlockedSymbol = "■" // U+2713 Check Mark StatusDoneSymbol = "✓" // U+26AB Medium Black Circle StatusAbandonedSymbol = "⚫" // U+25CB White Circle StatusPendingSymbol = "○" // U+2713 Check Mark StatusCompletedSymbol = "✓" // U+2717 Ballot X StatusDeletedSymbol = "✗" // U+2605 Black Star PriorityHighSymbol = "★" // U+2606 White Star PriorityMediumSymbol = "☆" // U+25E6 White Bullet PriorityLowSymbol = "◦" // U+25CB White Circle PriorityNoneSymbol = "○" // Three stars PriorityHighPattern = "★★★" // Two stars, one outline PriorityMediumPattern = "★★☆" // One star, two outline PriorityLowPattern = "★☆☆" // Three outline stars PriorityNonePattern = "☆☆☆" )
Variables ¶
var ( Success = lipgloss.NewStyle(). Foreground(lipgloss.Color(Julep.Hex())). Bold(true) Error = lipgloss.NewStyle(). Foreground(lipgloss.Color(Cherry.Hex())). Bold(true) Info = lipgloss.NewStyle(). Foreground(lipgloss.Color(Malibu.Hex())) Warning = lipgloss.NewStyle(). Foreground(lipgloss.Color(Citron.Hex())). Bold(true) Path = lipgloss.NewStyle(). Foreground(lipgloss.Color(Mustard.Hex())). Italic(true) )
var ( TaskTitle = lipgloss.NewStyle(). Foreground(lipgloss.Color(Salt.Hex())). Bold(true) TaskID = lipgloss.NewStyle(). Foreground(lipgloss.Color(Squid.Hex())). Width(8) )
var ( StatusPending = lipgloss.NewStyle(). Foreground(lipgloss.Color(Citron.Hex())) StatusCompleted = lipgloss.NewStyle(). Foreground(lipgloss.Color(Julep.Hex())) )
var ( PriorityHigh = lipgloss.NewStyle(). Foreground(lipgloss.Color(Cherry.Hex())). Bold(true) PriorityMedium = lipgloss.NewStyle(). Foreground(lipgloss.Color(Citron.Hex())) PriorityLow = lipgloss.NewStyle(). Foreground(lipgloss.Color(Squid.Hex())) )
var ( MovieStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(Coral.Hex())). Bold(true) TVStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(Violet.Hex())). Bold(true) BookStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(Guac.Hex())). Bold(true) MusicStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(Lichen.Hex())). Bold(true) )
var ( TableStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.NormalBorder()). BorderForeground(lipgloss.Color(Smoke.Hex())) SelectedStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(Salt.Hex())). Background(lipgloss.Color(Squid.Hex())). Bold(true) HeaderStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.NormalBorder()). BorderForeground(lipgloss.Color(Smoke.Hex())). BorderBottom(true). Bold(false) )
Table and UI styles
var ( // Gray TodoStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8")) // Blue InProgressStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("12")) // Red BlockedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("9")) // Green DoneStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("10")) // Dark Gray AbandonedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8")) // Light Gray PendingStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // Green CompletedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("10")) // Dark Red DeletedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("1")) // Bright Red - highest urgency PriorityHighStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("196")) // Yellow - medium urgency PriorityMediumStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("11")) // Cyan - low urgency PriorityLowStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("14")) // Gray - no priority PriorityNoneStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8")) // For legacy A-Z and numeric priorities PriorityLegacyStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("13")) // Magenta )
var ( TitleColorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(Guac.Hex())).Bold(true) SelectedColorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(Salt.Hex())).Bold(true) HeaderColorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(Malibu.Hex())).Bold(true) StatusColorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color(Julep.Hex())) )
var NoteleafColorScheme fang.ColorSchemeFunc = noteleafColorScheme
var ProvisionalColors []Key = []Key{NeueGuac, NeueZinc}
Functions ¶
func FormatPriorityIndicator ¶
FormatPriorityIndicator returns a styled priority pattern
func FormatPriorityWithText ¶
FormatPriorityWithText returns a styled priority with text description
func FormatStatusIndicator ¶
FormatStatusIndicator returns a styled status symbol and text
func FormatStatusWithText ¶
FormatStatusWithText returns a styled status symbol with status text
func FormatTaskPriority ¶
FormatTaskPriority returns a complete priority display with pattern, priority, and description
func FormatTaskStatus ¶
FormatTaskStatus returns a complete status display with symbol, status, and description
func GetAllPriorityPatterns ¶
GetAllPriorityPatterns returns a map of all priority patterns for reference
func GetAllPrioritySymbols ¶
GetAllPrioritySymbols returns a map of all priority symbols for reference
func GetAllStatusSymbols ¶
GetAllStatusSymbols returns a map of all status symbols for reference
func GetPriorityDescription ¶
GetPriorityDescription returns a human-friendly description of the priority
func GetPriorityDisplayType ¶
GetPriorityDisplayType returns the display type for a priority (text, numeric, or legacy)
func GetPriorityPattern ¶
GetPriorityPattern returns the star pattern for a given priority
func GetPriorityStyle ¶
GetPriorityStyle returns the color style for a given priority
func GetPrioritySymbol ¶
GetPrioritySymbol returns the unicode symbol for a given priority
func GetStatusDescription ¶
GetStatusDescription returns a human-friendly description of the status
func GetStatusStyle ¶
GetStatusStyle returns the color style for a given status
Defaults to pending style
func GetStatusSymbol ¶
GetStatusSymbol returns the unicode symbol for a given status
Default to pending
func IsValidStatusTransition ¶
IsValidStatusTransition checks if a status transition is logically valid
From todo, can go to in-progress, blocked, done, or abandoned From in-progress, can go to blocked, done, abandoned, or back to todo From blocked, can go to todo, in-progress, done, or abandoned From done, can only be reopened to todo or in-progress From abandoned, can be reopened to todo or in-progress
func PriorityLegend ¶
func PriorityLegend() string
PriorityLegend returns a formatted legend showing all priority patterns
func StatusLegend ¶
func StatusLegend() string
StatusLegend returns a formatted legend showing all status symbols
Types ¶
type BookList ¶
type BookList struct {
// contains filtered or unexported fields
}
BookList handles book search and selection UI
func NewBookList ¶
func NewBookList(service services.APIService, repo *repo.BookRepository, opts BookListOptions) *BookList
NewBookList creates a new book list UI component
func (*BookList) InteractiveSearch ¶
InteractiveSearch provides an interactive search interface
type BookListOptions ¶
type BookListOptions struct { // Output destination (stdout for interactive, buffer for testing) Output io.Writer // Input source (stdin for interactive, strings reader for testing) Input io.Reader // Enable static mode (no interactive components) Static bool }
BookListOptions configures the book list UI behavior
type Key ¶
type Key int
Key is a type for color keys.
const ( Cumin Key = iota Tang Yam Paprika Bengal Uni Sriracha Coral Salmon Chili Cherry Tuna Macaron Pony Cheeky Flamingo Dolly Blush Urchin Mochi Lilac Prince Violet Mauve Grape Plum Orchid Jelly Charple Hazy Ox Sapphire Guppy Oceania Thunder Anchovy Damson Malibu Sardine Zinc Turtle Lichen Guac Julep Bok Mustard Citron Zest Pepper BBQ Charcoal Iron Oyster Squid Smoke Ash Salt Butter // Diffs: additions. The brightest color in this set is Julep, defined above. Pickle Gator Spinach // Diffs: deletions. The brightest color in this set is Cherry, defined above. Pom Steak Toast // Provisional. NeueGuac NeueZinc )
func (Key) IsSecondary ¶
func (Key) IsTertiary ¶
func (Key) RGBA ¶
RGBA returns the red, green, blue, and alpha values of the color for interface color.Color
type Logo ¶
type Logo int
func (Logo) Colored ¶
Colored returns a colored version of the logo using lipgloss with vertical spiral design
Creates a vertical spiral effect by coloring character by character:
Combine line position and character position & use modulo to build wave-like transitions
func (Logo) ColoredInViewport ¶
ColoredInViewport returns the colored logo rendered inside a viewport bubble
type NoteList ¶
type NoteList struct {
// contains filtered or unexported fields
}
NoteList handles note browsing and viewing UI
func NewNoteList ¶
func NewNoteList(repo *repo.NoteRepository, opts NoteListOptions) *NoteList
NewNoteList creates a new note list UI component
type NoteListOptions ¶
type NoteListOptions struct { // Output destination (stdout for interactive, buffer for testing) Output io.Writer // Input source (stdin for interactive, strings reader for testing) Input io.Reader // Enable static mode (no interactive components) Static bool // Show archived notes ShowArchived bool // Filter by tags Tags []string }
NoteListOptions configures the note list UI behavior
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
Palette provides semantic color access
type ProjectList ¶
type ProjectList struct {
// contains filtered or unexported fields
}
ProjectList handles project browsing UI
func NewProjectList ¶
func NewProjectList(repo ProjectRepository, opts ProjectListOptions) *ProjectList
NewProjectList creates a new project list UI component
type ProjectListOptions ¶
type ProjectListOptions struct { // Output destination (stdout for interactive, buffer for testing) Output io.Writer // Input source (stdin for interactive, strings reader for testing) Input io.Reader // Enable static mode (no interactive components) Static bool }
ProjectListOptions configures the project list UI behavior
type ProjectRepository ¶
type ProjectRepository interface {
GetProjects(ctx context.Context) ([]repo.ProjectSummary, error)
}
ProjectRepository interface for dependency injection in tests
type TagList ¶
type TagList struct {
// contains filtered or unexported fields
}
TagList handles tag browsing UI
func NewTagList ¶
func NewTagList(repo TagRepository, opts TagListOptions) *TagList
NewTagList creates a new tag list UI component
type TagListOptions ¶
type TagListOptions struct { // Output destination (stdout for interactive, buffer for testing) Output io.Writer // Input source (stdin for interactive, strings reader for testing) Input io.Reader // Enable static mode (no interactive components) Static bool }
TagListOptions configures the tag list UI behavior
type TagRepository ¶
type TagRepository interface {
GetTags(ctx context.Context) ([]repo.TagSummary, error)
}
TagRepository interface for dependency injection in tests
type TaskEditOptions ¶
type TaskEditor ¶
type TaskEditor struct {
// contains filtered or unexported fields
}
func NewTaskEditor ¶
func NewTaskEditor(task *models.Task, repo TaskRepository, opts TaskEditOptions) *TaskEditor
type TaskList ¶
type TaskList struct {
// contains filtered or unexported fields
}
TaskList handles task browsing and viewing UI
func NewTaskList ¶
func NewTaskList(repo TaskRepository, opts TaskListOptions) *TaskList
NewTaskList creates a new task list UI component
type TaskListOptions ¶
type TaskListOptions struct { // Output destination (stdout for interactive, buffer for testing) Output io.Writer // Input source (stdin for interactive, strings reader for testing) Input io.Reader // Enable static mode (no interactive components) Static bool Status string Priority string Project string ShowAll bool }
TaskListOptions configures the task list UI behavior
type TaskRepository ¶
type TaskRepository interface { List(ctx context.Context, opts repo.TaskListOptions) ([]*models.Task, error) Update(ctx context.Context, task *models.Task) error }
TaskRepository interface for dependency injection in tests
type TaskView ¶
type TaskView struct {
// contains filtered or unexported fields
}
TaskView handles task detail viewing UI
func NewTaskView ¶
func NewTaskView(task *models.Task, opts TaskViewOptions) *TaskView
NewTaskView creates a new task view UI component
type TaskViewOptions ¶
type TaskViewOptions struct { // Output destination (stdout for interactive, buffer for testing) Output io.Writer // Input source (stdin for interactive, strings reader for testing) Input io.Reader // Enable static mode (no interactive components) Static bool // Width and height for viewport sizing Width int Height int }
TaskViewOptions configures the task view UI behavior