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

ANSI bright colors are impossible to use #30

Closed
airstrike opened this issue Aug 15, 2019 · 4 comments
Closed

ANSI bright colors are impossible to use #30

airstrike opened this issue Aug 15, 2019 · 4 comments
Labels

Comments

@airstrike
Copy link

https://github.com/timofurrer/colorful/search?q=rgb_to_ansi16&unscoped_q=rgb_to_ansi16

Though rgb_to_ansi16 includes a use_bright parameter, the user has no way of passing a True value to the function

@timofurrer
Copy link
Owner

Good catch, thanks for creating this issue!

I think the change would have to go somewhere in here:

red, green, blue = colorpalette[colorname]

Basically ANSI_16_COLORS should allow the bright colors in addition to the standard colors when using ANSI_8_COLORS.

I'm not entirely sure yet what the best implementation would look like - because here

def translate_rgb_to_ansi_code(red, green, blue, offset, colormode):

the colorname is already evaluated and something like bright_red would not be found (it's not a valid X11 color, and it depends on the used color palette anyway.)
Maybe we need some kind of logic in
def translate_rgb_to_ansi_code(red, green, blue, offset, colormode):

to determine whether the given RGB should be bright in case of the ANSI_16_COLORS mode ...

Any ideas?

@github-actions
Copy link

This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale label Oct 15, 2019
@airstrike
Copy link
Author

Haven't yet had time to think this through / work on it, but commenting on it so the issue isn't closed just yet.

@timofurrer timofurrer removed the stale label Oct 25, 2019
@github-actions
Copy link

This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

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

No branches or pull requests

2 participants