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

fix: minor typo in grayscale conversion #17

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

CannibalVox
Copy link
Contributor

The grayscale conversion takes 0..255 colors for the color indices determined in the first part of the algorithm and averages them and does some other stuff to convert them to a grayscale color.

Unfortunately, the existing code was taking the color indices instead of the 0..255 colors, which was causing the grayscale color to always be black, and rarely be chosen. This fix will improve conversion of grayscale colors.

@CannibalVox
Copy link
Contributor Author

Looks like the linter timed out

@meowgorithm
Copy link
Member

Re-running…

@aymanbagabas
Copy link
Member

Thank you for your contribution @CannibalVox! Could you write a test case covering this specific case?

@CannibalVox
Copy link
Contributor Author

That should do the trick, @aymanbagabas

Copy link
Member

@meowgorithm meowgorithm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a check for our internal sanity so we can reference hex codes for the ANSI256 colors in our charts. Thanks for the PR!

@meowgorithm meowgorithm merged commit 2b0f69a into charmbracelet:main Nov 21, 2024
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

Successfully merging this pull request may close these issues.

3 participants