[GH-ISSUE #863] White foreground with dim flag makes yellow #625

Closed
opened 2026-03-04 01:06:34 +03:00 by kerem · 4 comments
Owner

Originally created by @sewnie on GitHub (Jul 20, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/863

Following go snippet:

package main

import (
	"fmt"
	"github.com/rivo/tview"
)

func main() {
	app := tview.NewApplication()
	textView := tview.NewTextView().SetDynamicColors(true)
	fmt.Fprintf(textView, "[white::d]Hello World![-::-]\n")
	
	if err := app.SetRoot(textView, true).Run(); err != nil {
		panic(err)
	}
}

makes the following:
20230721_02h12m30s_grim

Originally created by @sewnie on GitHub (Jul 20, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/863 Following go snippet: ```go package main import ( "fmt" "github.com/rivo/tview" ) func main() { app := tview.NewApplication() textView := tview.NewTextView().SetDynamicColors(true) fmt.Fprintf(textView, "[white::d]Hello World![-::-]\n") if err := app.SetRoot(textView, true).Run(); err != nil { panic(err) } } ``` makes the following: ![20230721_02h12m30s_grim](https://github.com/rivo/tview/assets/47404953/c9d02909-8706-43ad-82c3-030abe46e48a)
kerem closed this issue 2026-03-04 01:06:35 +03:00
Author
Owner

@sewnie commented on GitHub (Jul 20, 2023):

20230721_02h17m16s_grim

<!-- gh-comment-id:1644775975 --> @sewnie commented on GitHub (Jul 20, 2023): ![20230721_02h17m16s_grim](https://github.com/rivo/tview/assets/47404953/2e97d93a-8f10-45dc-b53c-27d734bf584e)
Author
Owner

@sewnie commented on GitHub (Jul 29, 2023):

By using escape sequences, you're effectively bypassing what is allowed by tview...

<!-- gh-comment-id:1656580751 --> @sewnie commented on GitHub (Jul 29, 2023): By using escape sequences, you're effectively bypassing what is allowed by tview...
Author
Owner

@sewnie commented on GitHub (Jul 29, 2023):

Use this program:

package main

import (
	"fmt"
	"github.com/rivo/tview"
)

func main() {
	app := tview.NewApplication()
	textView := tview.NewTextView().SetDynamicColors(true)

	colors := []string{
		"black",
		"maroon",
		"green",
		"olive",
		"navy",
		"purple",
		"teal",
		"silver",
		"gray",
		"red",
		"lime",
		"yellow",
		"blue",
		"fuchsia",
		"aqua",
		"white",
	}

	for _, c := range colors {
		fmt.Fprintf(textView, "[%s::b]Hello World![-::-] ", c)
		fmt.Fprintf(textView, "[%s::br]Hello World![-::-] ", c)
		fmt.Fprintf(textView, "[%s::]Hello World![-::] ", c)
		fmt.Fprintf(textView, "[%s::r]Hello World![-::-] ", c)
		fmt.Fprintf(textView, "[%s::d]Hello World![-::-] ", c)
		fmt.Fprintf(textView, "[%s::dr]Hello World![-::-]\n", c)
	}
	
	if err := app.SetRoot(textView, true).Run(); err != nil {
		panic(err)
	}
}

However, you are right:
image
I'll look into this.

<!-- gh-comment-id:1656581163 --> @sewnie commented on GitHub (Jul 29, 2023): Use this program: ```go package main import ( "fmt" "github.com/rivo/tview" ) func main() { app := tview.NewApplication() textView := tview.NewTextView().SetDynamicColors(true) colors := []string{ "black", "maroon", "green", "olive", "navy", "purple", "teal", "silver", "gray", "red", "lime", "yellow", "blue", "fuchsia", "aqua", "white", } for _, c := range colors { fmt.Fprintf(textView, "[%s::b]Hello World![-::-] ", c) fmt.Fprintf(textView, "[%s::br]Hello World![-::-] ", c) fmt.Fprintf(textView, "[%s::]Hello World![-::] ", c) fmt.Fprintf(textView, "[%s::r]Hello World![-::-] ", c) fmt.Fprintf(textView, "[%s::d]Hello World![-::-] ", c) fmt.Fprintf(textView, "[%s::dr]Hello World![-::-]\n", c) } if err := app.SetRoot(textView, true).Run(); err != nil { panic(err) } } ``` However, you are right: ![image](https://github.com/rivo/tview/assets/47404953/278efb3a-fbfc-4a84-8e8d-b29082ff3b26) I'll look into this.
Author
Owner

@sewnie commented on GitHub (Jul 29, 2023):

Yep, you're right. my terminal is the issue, thanks alot for clarifying!

<!-- gh-comment-id:1656582825 --> @sewnie commented on GitHub (Jul 29, 2023): Yep, you're right. my terminal is the issue, thanks alot for clarifying!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#625
No description provided.