Changing Blue color in demos to a more readable shade.

This commit is contained in:
Jakub Sobon 2020-11-14 01:41:29 -05:00
parent 20d07d05e8
commit 3e476963e8
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
9 changed files with 18 additions and 18 deletions

View File

@ -569,7 +569,7 @@ func textState(text string, capacity, step int) []rune {
// SegmentDisplay.
func newTextInput(updateText chan<- string) (*textinput.TextInput, error) {
input, err := textinput.New(
textinput.Label("Change text to: ", cell.FgColor(cell.ColorBlue)),
textinput.Label("Change text to: ", cell.FgColor(cell.ColorNumber(33))),
textinput.MaxWidthCells(20),
textinput.PlaceHolder("enter any text"),
textinput.OnSubmit(func(text string) error {
@ -593,10 +593,10 @@ func newSegmentDisplay(ctx context.Context, updateText <-chan string) (*segmentd
}
colors := []cell.Color{
cell.ColorBlue,
cell.ColorNumber(33),
cell.ColorRed,
cell.ColorYellow,
cell.ColorBlue,
cell.ColorNumber(33),
cell.ColorGreen,
cell.ColorRed,
cell.ColorGreen,
@ -854,7 +854,7 @@ func newSines(ctx context.Context) (left, right *button.Button, lc *linechart.Li
go periodic(ctx, redrawInterval/3, func() error {
step1 = (step1 + 1) % len(inputs)
if err := lc.Series("first", rotateFloats(inputs, step1),
linechart.SeriesCellOpts(cell.FgColor(cell.ColorBlue)),
linechart.SeriesCellOpts(cell.FgColor(cell.ColorNumber(33))),
); err != nil {
return err
}

View File

@ -75,10 +75,10 @@ func main() {
barchart.ValueColors([]cell.Color{
cell.ColorRed,
cell.ColorYellow,
cell.ColorBlue,
cell.ColorNumber(33),
cell.ColorGreen,
cell.ColorRed,
cell.ColorBlue,
cell.ColorNumber(33),
}),
barchart.ShowValues(),
barchart.BarWidth(8),

View File

@ -95,7 +95,7 @@ func main() {
}
go playDonut(ctx, green, 0, 1, 250*time.Millisecond, playTypePercent)
blue, err := donut.New(donut.CellOpts(cell.FgColor(cell.ColorBlue)))
blue, err := donut.New(donut.CellOpts(cell.FgColor(cell.ColorNumber(33))))
if err != nil {
panic(err)
}

View File

@ -98,7 +98,7 @@ func main() {
absolute, err := gauge.New(
gauge.Height(1),
gauge.Color(cell.ColorBlue),
gauge.Color(cell.ColorNumber(33)),
gauge.Border(linestyle.Light),
gauge.BorderTitle("Absolute progress"),
)

View File

@ -53,7 +53,7 @@ func playLineChart(ctx context.Context, lc *linechart.LineChart, delay time.Dura
i = (i + 1) % len(inputs)
rotated := append(inputs[i:], inputs[:i]...)
if err := lc.Series("first", rotated,
linechart.SeriesCellOpts(cell.FgColor(cell.ColorBlue)),
linechart.SeriesCellOpts(cell.FgColor(cell.ColorNumber(33))),
linechart.SeriesXLabels(map[int]string{
0: "zero",
}),

View File

@ -46,7 +46,7 @@ func clock(ctx context.Context, sd *segmentdisplay.SegmentDisplay) {
spacer = ":"
}
chunks := []*segmentdisplay.TextChunk{
segmentdisplay.NewChunk(parts[0], segmentdisplay.WriteCellOpts(cell.FgColor(cell.ColorBlue))),
segmentdisplay.NewChunk(parts[0], segmentdisplay.WriteCellOpts(cell.FgColor(cell.ColorNumber(33)))),
segmentdisplay.NewChunk(spacer),
segmentdisplay.NewChunk(parts[1], segmentdisplay.WriteCellOpts(cell.FgColor(cell.ColorRed))),
}
@ -74,10 +74,10 @@ func rotate(inputs []rune, step int) []rune {
func rollText(ctx context.Context, sd *segmentdisplay.SegmentDisplay) {
const text = "Termdash"
colors := map[rune]cell.Color{
'T': cell.ColorBlue,
'T': cell.ColorNumber(33),
'e': cell.ColorRed,
'r': cell.ColorYellow,
'm': cell.ColorBlue,
'm': cell.ColorNumber(33),
'd': cell.ColorGreen,
'a': cell.ColorRed,
's': cell.ColorGreen,

View File

@ -84,7 +84,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
green, err := sparkline.New(
sparkline.Label("Green SparkLine", cell.FgColor(cell.ColorBlue)),
sparkline.Label("Green SparkLine", cell.FgColor(cell.ColorNumber(33))),
sparkline.Color(cell.ColorGreen),
)
if err != nil {
@ -92,7 +92,7 @@ func main() {
}
go playSparkLine(ctx, green, 250*time.Millisecond)
red, err := sparkline.New(
sparkline.Label("Red SparkLine", cell.FgColor(cell.ColorBlue)),
sparkline.Label("Red SparkLine", cell.FgColor(cell.ColorNumber(33))),
sparkline.Color(cell.ColorRed),
)
if err != nil {

View File

@ -106,7 +106,7 @@ func main() {
if err := wrapped.Write("Supports", text.WriteCellOpts(cell.FgColor(cell.ColorRed))); err != nil {
panic(err)
}
if err := wrapped.Write(" colors", text.WriteCellOpts(cell.FgColor(cell.ColorBlue))); err != nil {
if err := wrapped.Write(" colors", text.WriteCellOpts(cell.FgColor(cell.ColorNumber(33)))); err != nil {
panic(err)
}
if err := wrapped.Write(" and"); err != nil {

View File

@ -60,10 +60,10 @@ func textState(text string, capacity, step int) []rune {
// Exists when the context expires.
func rollText(ctx context.Context, sd *segmentdisplay.SegmentDisplay, updateText <-chan string) {
colors := []cell.Color{
cell.ColorBlue,
cell.ColorNumber(33),
cell.ColorRed,
cell.ColorYellow,
cell.ColorBlue,
cell.ColorNumber(33),
cell.ColorGreen,
cell.ColorRed,
cell.ColorGreen,
@ -127,7 +127,7 @@ func main() {
go rollText(ctx, rollingSD, updateText)
input, err := textinput.New(
textinput.Label("New text:", cell.FgColor(cell.ColorBlue)),
textinput.Label("New text:", cell.FgColor(cell.ColorNumber(33))),
textinput.MaxWidthCells(20),
textinput.Border(linestyle.Light),
textinput.PlaceHolder("Enter any text"),