-
Notifications
You must be signed in to change notification settings - Fork 30
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
Feature Ideas #11
Comments
hi @jlarmstrongiv, have you found a different solution that incorporates these features? Or still just ideas at this point? |
Happy Easter 🐣@markjackson02 Unfortunately, I haven’t found any alternative solutions. Just ideas at this point. Personally, I’m building on a little color web app and haven’t worked on that feature yet |
@jlarmstrongiv did you get to implementing these ideas yet? I know it's only been a few months but I like your ideas and would like to apply them :) |
Hi @starkana While I created an mvp for the color app, I ran out of time to include this feature. I would love to work on the project more, but I am in need of finding a job. After that, there’s a good chance it’ll be my weekend project :) |
Features
Perceptual Distance
I like this library a lot! However, by using the pure and numerical RGB approach, this library does not calculate the closest color according to human perception.
It would be great to support a custom distance algorithm, such as one from DeltaE.
.nearestColors() // returns array
Also, if this library is used to present colors to the user, it may be beneficial to present say, the top five closest colors. Or, perhaps re-order the entire color array according to closest distance.
Custom color dictionaries
I am working with color dictionaries (aka Pantone) that define multiple properties of colors. For instance, it uses array of colors that look like:
There are many types of color formats as well. Chroma.js supports many of these color formats.
It would be great to support passing in a colors array of objects, and specifying the key where the color could be found.
Implementation Intricacies
The trouble is that different distance calculators require different color modes. For example, the current distance calculator in this library uses hex codes. The DeltaE distance calculator uses Lab colors.
I think the user should be responsive for providing the right format for the right distance calculator. That way, the user could cache the results of color converting RGB => Hex or RGB => Lab (etc).
Using color dictionaries would allow users to save the pre-computed results of those color conversions within the colors array itself. For instance, when nearestColor() is called multiple times, it knows the key/path of the pre-computed color and saves time. Thus, the user (not this library) will choose its preferred way of converting colors and caching them.
These ideas may necessitate a V2 of the
nearest-color
package. However, it will add beneficial features. What do you think? Ifnearest-color
isn’t the right package for these features, please let me know, and I’ll create a different package.The text was updated successfully, but these errors were encountered: