seppwc / color-delta-e Goto Github PK
View Code? Open in Web Editor NEWA Tiny library for measuring the perceived visual difference between two colors
License: MIT License
A Tiny library for measuring the perceived visual difference between two colors
License: MIT License
another handy function to include would be a sorting function that sorts colors by the deltaE compared to a base color
const sorted = sort('#dd2244', ['#e83b3b', '#db2424', '#df1111', '#b50303'])
sorted // ['#b50303', '#df1111', '#db2424', '#e83b3b']
A good feature to add to the repo would be a filter function that takes a base color and a list of colors (like selector) and returns a new list of colors containing only the percievable colors inside.
const filtered = filter('#dd2244', ['#dd2244' ,'#e83b3b', '#45b0b0'], {
// options
})
filters // ['#dd2244', '#45b0b0']
this could probably be implemented easily with the current functions we have already
const filtered = ['#dd2244' ,'#e83b3b', '#45b0b0'].filter((color)=>{
return isPerceiveable('#dd2244', color)
})
along with filter and sort, it might be useful to create a pipe function that takes a base color and then and array of various operation functions, to make filtering, sorted etc more functional
// arg1: baseColor to compare, args...: operation functions
const getOrderedPerceiveableColors = pipe('#dd2244', filter, sort)
const colors = getOrderedPerceiveableColors(['#b50303', '#c73d3d', '#d97878'])
colors // ['#d97878', '#b50303']
these two have been added to main but no docs are written for them, these should ideally be added before next minor update
doesnt make sense to have all these as part of the package, lets add them to a separate repo/npm package with color-delta-e as a peer dep
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.