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

"Nearest color" functionality #117

Open
fromaline opened this issue Sep 29, 2023 · 0 comments
Open

"Nearest color" functionality #117

fromaline opened this issue Sep 29, 2023 · 0 comments

Comments

@fromaline
Copy link

First off, great library! Thanks for developing and maintaining it 🙏

I have a feature request:
A utility function for finding the nearest color. Similar to what nearest-color does, but with TS support and thorough testing.

// example from nearest-color

var colors = {
  red: '#f00',
  yellow: '#ff0',
  blue: '#00f'
};

var nearestColor = require('nearest-color').from(colors);

nearestColor('#800'); // => { name: 'red', value: '#f00', rgb: { r: 255, g: 0, b: 0 }, distance: 119 }
nearestColor('#ffe'); // => { name: 'yellow', value: '#ff0', rgb: { r: 255, g: 255, b: 0 }, distance: 238 }

Do you think it worth implementing? Or is it's irrelevant for your library?

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

No branches or pull requests

1 participant