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

Add converter from image/color.Color to tcell.Color #456

Merged
merged 1 commit into from May 11, 2021
Merged

Add converter from image/color.Color to tcell.Color #456

merged 1 commit into from May 11, 2021

Conversation

spenserblack
Copy link
Contributor

Resolves #450

Converts from `image/color.Color` to `tcell.Color`.
@codecov
Copy link

codecov bot commented May 11, 2021

Codecov Report

❗ No coverage uploaded for pull request base (master@299cb41). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #456   +/-   ##
=========================================
  Coverage          ?   17.07%           
=========================================
  Files             ?       20           
  Lines             ?     1388           
  Branches          ?        0           
=========================================
  Hits              ?      237           
  Misses            ?     1137           
  Partials          ?       14           
Impacted Files Coverage Δ
color.go 86.20% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 299cb41...1556756. Read the comment docs.

@gdamore
Copy link
Owner

gdamore commented May 11, 2021

I was a bit hesitant about this at first, but it seems kind of ok. I don't think it brings huge value, but as image/color is part of the standard library I guess it's worth doing. I looked a bit more closely at image/color and can say that I would not recommend using it's matching, which is the naive Euclidean shortest path match. (Otherwise I might be tempted to use it for the color handling internally. Alas, it's not up to it.)

@gdamore gdamore merged commit 8f925d8 into gdamore:master May 11, 2021
@spenserblack spenserblack deleted the feature/from-image-color branch May 11, 2021 19:50
@spenserblack
Copy link
Contributor Author

Thanks for merging!

I don't think it brings huge value

I'm currently working on a project to view images in the terminal, and this small function can help a lot. Not a huge value, but I think rendering images in terminal is common enough (e.g. termui's image widget) for this library to provide this utility.

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.

image/color.Color to tcell.Color conversion function
2 participants