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 'compare' or 'difference' subcommand #21

Open
sharkdp opened this issue Jun 17, 2019 · 5 comments
Open

Add 'compare' or 'difference' subcommand #21

sharkdp opened this issue Jun 17, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@sharkdp
Copy link
Owner

sharkdp commented Jun 17, 2019

Which computes contrast, color difference, etc.

in the interactive version, we could show a-colored text on a b-colored background. Also, show two color panels (like in pastel color) directly next to each other.

@sharkdp sharkdp modified the milestone: Initial release Aug 24, 2019
@sharkdp sharkdp added the enhancement New feature or request label Aug 29, 2019
@JuanPotato
Copy link

image

I was in the process of writing this feature, but I'm not sure what else to add in for text. I also wanted to ask if there was a way to print styled text at a specific location. I can see Canvas has draw_text but that only draws unstyled text at a certain location. The paint subcommand uses the paint function in Brush but that doesn't accept a position.

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 22, 2019

Awesome, thank you for looking into this.

As for more information, I think we should also display the CIEDE2000 color difference. Other interesting quantities could be ΔL(ightness) or ΔH(ue).

For both the contrast ratio and the color difference, we could also provide a little context as to what these values represent (e.g.: "not noticeable" or "high" for the difference).

For more information on contrast ratios, see: https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef

I guess there is no way (yet) to draw colorized text, no.

@bresilla
Copy link
Contributor

bresilla commented Nov 29, 2020

Hi @JuanPotato

Do you mind sharing what you've worked about this so far, so i can have a look at it and check if i can implement this?? (cos in your screenshots seem you've already have something working...)

Thank you.

P.S. I checked if you've got t in your public repos but couldn't find it.

@JuanPotato
Copy link

https://github.com/JuanPotato/pastel/tree/compare

Did you look at this branch?

@bresilla
Copy link
Contributor

@JuanPotato Thank you.

No I have not. But now whenever have some free time in coming weeks I'll give it a go...

What i am thinking is that: the logic that does "the sorting" (command: sort-by) already holds the logic of comparison of colors based on brightness, luminance, hue and chroma, so I'll take that logic/code and use with your code that you implemented for cli entry (command: compare) and other components.

I didn't go enough into the source code of pastel, but i think this can be done. But maybe i am wrong into thinking this, so I'll see.

Thank you again :)

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

No branches or pull requests

3 participants