1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
package cview
import "github.com/gdamore/tcell/v2"
// Theme defines the colors used when primitives are initialized.
type Theme struct {
// 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.
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.
// Check box
CheckBoxCheckedRune rune
// Context menu
ContextMenuPaddingTop int
ContextMenuPaddingBottom int
ContextMenuPaddingLeft int
ContextMenuPaddingRight int
// 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.
// Scroll bar
ScrollBarColor tcell.Color
// Window
WindowMinWidth int
WindowMinHeight int
}
// 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.
var Styles = Theme{
TitleColor: tcell.ColorWhite.TrueColor(),
BorderColor: tcell.ColorWhite.TrueColor(),
GraphicsColor: tcell.ColorWhite.TrueColor(),
PrimaryTextColor: tcell.ColorWhite.TrueColor(),
SecondaryTextColor: tcell.ColorYellow.TrueColor(),
TertiaryTextColor: tcell.ColorGreen.TrueColor(),
InverseTextColor: tcell.ColorBlue.TrueColor(),
ContrastPrimaryTextColor: tcell.ColorBlack.TrueColor(),
ContrastSecondaryTextColor: tcell.ColorDarkCyan.TrueColor(),
PrimitiveBackgroundColor: tcell.ColorBlack.TrueColor(),
ContrastBackgroundColor: tcell.ColorBlue.TrueColor(),
MoreContrastBackgroundColor: tcell.ColorGreen.TrueColor(),
CheckBoxCheckedRune: 'X',
ContextMenuPaddingTop: 0,
ContextMenuPaddingBottom: 0,
ContextMenuPaddingLeft: 1,
ContextMenuPaddingRight: 1,
DropDownAbbreviationChars: "...",
DropDownSymbol: '▼',
ScrollBarColor: tcell.ColorWhite.TrueColor(),
WindowMinWidth: 4,
WindowMinHeight: 3,
}
|