...

Source file src/gitlab.com/tslocum/cview/styles.go

Documentation: gitlab.com/tslocum/cview

     1  package cview
     2  
     3  import "github.com/gdamore/tcell/v2"
     4  
     5  // Theme defines the colors used when primitives are initialized.
     6  type Theme struct {
     7  	// Title, border and other lines
     8  	TitleColor    tcell.Color // Box titles.
     9  	BorderColor   tcell.Color // Box borders.
    10  	GraphicsColor tcell.Color // Graphics.
    11  
    12  	// Text
    13  	PrimaryTextColor           tcell.Color // Primary text.
    14  	SecondaryTextColor         tcell.Color // Secondary text (e.g. labels).
    15  	TertiaryTextColor          tcell.Color // Tertiary text (e.g. subtitles, notes).
    16  	InverseTextColor           tcell.Color // Text on primary-colored backgrounds.
    17  	ContrastPrimaryTextColor   tcell.Color // Primary text for contrasting elements.
    18  	ContrastSecondaryTextColor tcell.Color // Secondary text on ContrastBackgroundColor-colored backgrounds.
    19  
    20  	// Background
    21  	PrimitiveBackgroundColor    tcell.Color // Main background color for primitives.
    22  	ContrastBackgroundColor     tcell.Color // Background color for contrasting elements.
    23  	MoreContrastBackgroundColor tcell.Color // Background color for even more contrasting elements.
    24  
    25  	// Check box
    26  	CheckBoxCheckedRune rune
    27  
    28  	// Context menu
    29  	ContextMenuPaddingTop    int
    30  	ContextMenuPaddingBottom int
    31  	ContextMenuPaddingLeft   int
    32  	ContextMenuPaddingRight  int
    33  
    34  	// Drop down
    35  	DropDownAbbreviationChars string // The chars to show when the option's text gets shortened.
    36  	DropDownSymbol            rune   // The symbol to draw at the end of the field.
    37  
    38  	// Scroll bar
    39  	ScrollBarColor tcell.Color
    40  
    41  	// Window
    42  	WindowMinWidth  int
    43  	WindowMinHeight int
    44  }
    45  
    46  // Styles defines the appearance of an application. The default is for a black
    47  // background and some basic colors: black, white, yellow, green, cyan, and
    48  // blue.
    49  var Styles = Theme{
    50  	TitleColor:    tcell.ColorWhite.TrueColor(),
    51  	BorderColor:   tcell.ColorWhite.TrueColor(),
    52  	GraphicsColor: tcell.ColorWhite.TrueColor(),
    53  
    54  	PrimaryTextColor:           tcell.ColorWhite.TrueColor(),
    55  	SecondaryTextColor:         tcell.ColorYellow.TrueColor(),
    56  	TertiaryTextColor:          tcell.ColorGreen.TrueColor(),
    57  	InverseTextColor:           tcell.ColorBlue.TrueColor(),
    58  	ContrastPrimaryTextColor:   tcell.ColorBlack.TrueColor(),
    59  	ContrastSecondaryTextColor: tcell.ColorDarkCyan.TrueColor(),
    60  
    61  	PrimitiveBackgroundColor:    tcell.ColorBlack.TrueColor(),
    62  	ContrastBackgroundColor:     tcell.ColorBlue.TrueColor(),
    63  	MoreContrastBackgroundColor: tcell.ColorGreen.TrueColor(),
    64  
    65  	CheckBoxCheckedRune: 'X',
    66  
    67  	ContextMenuPaddingTop:    0,
    68  	ContextMenuPaddingBottom: 0,
    69  	ContextMenuPaddingLeft:   1,
    70  	ContextMenuPaddingRight:  1,
    71  
    72  	DropDownAbbreviationChars: "...",
    73  	DropDownSymbol:            '▼',
    74  
    75  	ScrollBarColor: tcell.ColorWhite.TrueColor(),
    76  
    77  	WindowMinWidth:  4,
    78  	WindowMinHeight: 3,
    79  }
    80  

View as plain text