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. // SegmentDisplay.
func newTextInput(updateText chan<- string) (*textinput.TextInput, error) { func newTextInput(updateText chan<- string) (*textinput.TextInput, error) {
input, err := textinput.New( 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.MaxWidthCells(20),
textinput.PlaceHolder("enter any text"), textinput.PlaceHolder("enter any text"),
textinput.OnSubmit(func(text string) error { textinput.OnSubmit(func(text string) error {
@ -593,10 +593,10 @@ func newSegmentDisplay(ctx context.Context, updateText <-chan string) (*segmentd
} }
colors := []cell.Color{ colors := []cell.Color{
cell.ColorBlue, cell.ColorNumber(33),
cell.ColorRed, cell.ColorRed,
cell.ColorYellow, cell.ColorYellow,
cell.ColorBlue, cell.ColorNumber(33),
cell.ColorGreen, cell.ColorGreen,
cell.ColorRed, cell.ColorRed,
cell.ColorGreen, 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 { go periodic(ctx, redrawInterval/3, func() error {
step1 = (step1 + 1) % len(inputs) step1 = (step1 + 1) % len(inputs)
if err := lc.Series("first", rotateFloats(inputs, step1), if err := lc.Series("first", rotateFloats(inputs, step1),
linechart.SeriesCellOpts(cell.FgColor(cell.ColorBlue)), linechart.SeriesCellOpts(cell.FgColor(cell.ColorNumber(33))),
); err != nil { ); err != nil {
return err return err
} }

View File

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

View File

@ -95,7 +95,7 @@ func main() {
} }
go playDonut(ctx, green, 0, 1, 250*time.Millisecond, playTypePercent) 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 { if err != nil {
panic(err) panic(err)
} }

View File

@ -98,7 +98,7 @@ func main() {
absolute, err := gauge.New( absolute, err := gauge.New(
gauge.Height(1), gauge.Height(1),
gauge.Color(cell.ColorBlue), gauge.Color(cell.ColorNumber(33)),
gauge.Border(linestyle.Light), gauge.Border(linestyle.Light),
gauge.BorderTitle("Absolute progress"), 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) i = (i + 1) % len(inputs)
rotated := append(inputs[i:], inputs[:i]...) rotated := append(inputs[i:], inputs[:i]...)
if err := lc.Series("first", rotated, if err := lc.Series("first", rotated,
linechart.SeriesCellOpts(cell.FgColor(cell.ColorBlue)), linechart.SeriesCellOpts(cell.FgColor(cell.ColorNumber(33))),
linechart.SeriesXLabels(map[int]string{ linechart.SeriesXLabels(map[int]string{
0: "zero", 0: "zero",
}), }),

View File

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

View File

@ -84,7 +84,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
green, err := sparkline.New( 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), sparkline.Color(cell.ColorGreen),
) )
if err != nil { if err != nil {
@ -92,7 +92,7 @@ func main() {
} }
go playSparkLine(ctx, green, 250*time.Millisecond) go playSparkLine(ctx, green, 250*time.Millisecond)
red, err := sparkline.New( 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), sparkline.Color(cell.ColorRed),
) )
if err != nil { if err != nil {

View File

@ -106,7 +106,7 @@ func main() {
if err := wrapped.Write("Supports", text.WriteCellOpts(cell.FgColor(cell.ColorRed))); err != nil { if err := wrapped.Write("Supports", text.WriteCellOpts(cell.FgColor(cell.ColorRed))); err != nil {
panic(err) 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) panic(err)
} }
if err := wrapped.Write(" and"); err != nil { 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. // Exists when the context expires.
func rollText(ctx context.Context, sd *segmentdisplay.SegmentDisplay, updateText <-chan string) { func rollText(ctx context.Context, sd *segmentdisplay.SegmentDisplay, updateText <-chan string) {
colors := []cell.Color{ colors := []cell.Color{
cell.ColorBlue, cell.ColorNumber(33),
cell.ColorRed, cell.ColorRed,
cell.ColorYellow, cell.ColorYellow,
cell.ColorBlue, cell.ColorNumber(33),
cell.ColorGreen, cell.ColorGreen,
cell.ColorRed, cell.ColorRed,
cell.ColorGreen, cell.ColorGreen,
@ -127,7 +127,7 @@ func main() {
go rollText(ctx, rollingSD, updateText) go rollText(ctx, rollingSD, updateText)
input, err := textinput.New( 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.MaxWidthCells(20),
textinput.Border(linestyle.Light), textinput.Border(linestyle.Light),
textinput.PlaceHolder("Enter any text"), textinput.PlaceHolder("Enter any text"),