Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

256 colour terminal support #2

Open
jai-x opened this issue May 24, 2018 · 1 comment
Open

256 colour terminal support #2

jai-x opened this issue May 24, 2018 · 1 comment

Comments

@jai-x
Copy link

jai-x commented May 24, 2018

This music player is really cool, although I am missing out on the album art feature due to not having a true colour terminal available.

Could there be an option such that the colours used in the album art display be approximated to within the 256 colour range?

@eugene-eeo
Copy link
Owner

eugene-eeo commented May 24, 2018

Hi, I'll give it a go when I'm free. Although your best bet if you really want to use it (and know some Go) is to look into ansimage/ansimage.go and manually tweak it so that you approximate the true RGB values. I won't be changing this file much, so it is safe (for the foreseeable future) to mess about with it in your fork. Line 88 is where you should modify:

// Render returns the ANSI-compatible string form of ANSI-pixel.
func (ap *ANSIpixel) Render() string {
	if ap.upper {
		return fmt.Sprintf(
			"\033[48;2;%d;%d;%dm",
			ap.R, ap.G, ap.B,
		)
	}
	return fmt.Sprintf(
		"\033[38;2;%d;%d;%dm%s",
		ap.R, ap.G, ap.B,
		lowerHalfBlock,
	)
}

PS: In the future I might port orchid to use gdamore/tcell to avoid hacking around termbox so I will change the file, but I don't really have a hard deadline on when I'll do that, if ever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants