Terminal-based user interface toolkit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.6 KiB

package cview
import "github.com/gdamore/tcell/v2"
// Theme defines the colors used when primitives are initialized.
4 years ago
type Theme struct {
2 years ago
// Title, border and other lines
TitleColor tcell.Color // Box titles.
BorderColor tcell.Color // Box borders.
GraphicsColor tcell.Color // Graphics.
// Text
PrimaryTextColor tcell.Color // Primary text.
SecondaryTextColor tcell.Color // Secondary text (e.g. labels).
TertiaryTextColor tcell.Color // Tertiary text (e.g. subtitles, notes).
InverseTextColor tcell.Color // Text on primary-colored backgrounds.
ContrastPrimaryTextColor tcell.Color // Primary text for contrasting elements.
2 years ago
ContrastSecondaryTextColor tcell.Color // Secondary text on ContrastBackgroundColor-colored backgrounds.
// Background
PrimitiveBackgroundColor tcell.Color // Main background color for primitives.
ContrastBackgroundColor tcell.Color // Background color for contrasting elements.
MoreContrastBackgroundColor tcell.Color // Background color for even more contrasting elements.
2 years ago
// Scroll bar
ScrollBarColor tcell.Color // Scroll bar color.
2 years ago
// Context menu
ContextMenuPaddingTop int // Top padding.
ContextMenuPaddingBottom int // Bottom padding.
ContextMenuPaddingLeft int // Left padding.
ContextMenuPaddingRight int // Right padding.
// Check box
CheckBoxCheckedRune rune
// Drop down
DropDownAbbreviationChars string // The chars to show when the option's text gets shortened.
DropDownSymbol rune // The symbol to draw at the end of the field.
4 years ago
}
// Styles defines the appearance of an application. The default is for a black
// background and some basic colors: black, white, yellow, green, cyan, and
// blue.
4 years ago
var Styles = Theme{
TitleColor: tcell.ColorWhite.TrueColor(),
BorderColor: tcell.ColorWhite.TrueColor(),
GraphicsColor: tcell.ColorWhite.TrueColor(),
2 years ago
PrimaryTextColor: tcell.ColorWhite.TrueColor(),
SecondaryTextColor: tcell.ColorYellow.TrueColor(),
TertiaryTextColor: tcell.ColorGreen.TrueColor(),
InverseTextColor: tcell.ColorBlue.TrueColor(),
ContrastPrimaryTextColor: tcell.ColorBlack.TrueColor(),
ContrastSecondaryTextColor: tcell.ColorDarkCyan.TrueColor(),
2 years ago
PrimitiveBackgroundColor: tcell.ColorBlack.TrueColor(),
ContrastBackgroundColor: tcell.ColorBlue.TrueColor(),
MoreContrastBackgroundColor: tcell.ColorGreen.TrueColor(),
ScrollBarColor: tcell.ColorWhite.TrueColor(),
2 years ago
ContextMenuPaddingTop: 0,
ContextMenuPaddingBottom: 0,
ContextMenuPaddingLeft: 1,
ContextMenuPaddingRight: 1,
CheckBoxCheckedRune: 'X',
DropDownAbbreviationChars: "...",
DropDownSymbol: '▼',
}