Live data from Hacker News

Show HN: hue.tools – open-source toolbox for colors

hue.tools

71–80 of 82 posts

Re: Show HN: hue.tools – open-source toolbox for colors

#71
post #52

It's been said several times already but I really love the names. They add so much flavor to it and, surprisingly enough, really seem to get my imagination going, haha.

Same, I'm so glad someone is taking the time to come up with all of those amazing names.

Re: Show HN: hue.tools – open-source toolbox for colors

#72

I love this tool, especially that it's built with SvelteKit. Thanks for sharing it! One thing I'm curious about that I couldn't discern from the GH repo: what's the license?

Oh, I totally missed adding a license... Definitely gonna add it later. In case you want to know now: it's gonna be MIT. Thank you!

Re: Show HN: hue.tools – open-source toolbox for colors

#73

nice project! Suggestion: for the blending tool, you could show a grid of every blending mode at once instead of needing to pick the blending mode one by one

Ohh, very cool idea. I'll experiment with that a bit and see how this could work. Thanks for the suggestion!

Re: Show HN: hue.tools – open-source toolbox for colors

#75

Is it possible to know about a certain color if it's dark or light? My goal is to automatically determine whether to put a white or black text on top of a background colored box based on the answer. Is it has something to do with the temperature? I'd expect to get some value below or above 0.5.

Look at the L for either LAB or LCH. It'll be between 0 and 100.

Re: Show HN: hue.tools – open-source toolbox for colors

#76

Is it possible to know about a certain color if it's dark or light? My goal is to automatically determine whether to put a white or black text on top of a background colored box based on the answer. Is it has something to do with the temperature? I'd expect to get some value below or above 0.5.

A simple function is to calculate whether the total of each RGB channel reaches a certain threshold, with different weights given to each channel. For an example, see the YIQ contrast function used by Bootstrap v4 [0].

WCAG defines their own algorithm for calculating the contrast between two colours to ensure good accessibility [1][2]. Bootstrap v5 uses this [3].

[0] https://github.com/twbs/bootstrap/blob/v4.6.1/scss/_function...

[1] https://www.w3.org/WAI/GL/wiki/Relative_luminance

[2] https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests

[3] https://github.com/twbs/bootstrap/blob/v5.1.3/scss/_function...

Re: Show HN: hue.tools – open-source toolbox for colors

#77

Is it possible to know about a certain color if it's dark or light? My goal is to automatically determine whether to put a white or black text on top of a background colored box based on the answer. Is it has something to do with the temperature? I'd expect to get some value below or above 0.5.

Great idea. I think this will fit nicely with the info tool. Also a accessibility contrast score might also be helpful. I will take a look at that. Thanks!

Re: Show HN: hue.tools – open-source toolbox for colors

#79
post #43
post #35

Earlier quoted context omitted.

First of all thanks for the comments and info. I'm actually not doing the color interpolation myself. I'm using chroma.js[1] for the most part. You can actually change the interpolation mode on the bottom below the color boxes. The default is LCH because I think it looks the best most of the time, but you can use LAB if you prefer that. [1] https://gka.github.io/chroma.js/

Aha! That was a bonehead miss on my part. Very nice, and very slick interface. :)

Well it is very easy to miss. ;) Thank you!
Post reply on HN