Returns the nearest color(s) in a collection as compared against the passed in color using the differenceHyab metric function.
against
differenceHyab
tailwind
collection
num
The collection of colors to search for nearest colors.
Optional
Optional overrides with num and against properties.
let cols = colors('all', '500')console.log(nearest(cols, 'blue', 3));// [ '#a855f7', '#8b5cf6', '#d946ef' ] Copy
let cols = colors('all', '500')console.log(nearest(cols, 'blue', 3));// [ '#a855f7', '#8b5cf6', '#d946ef' ]
Returns the nearest color(s) in a collection as compared
againstthe passed in color using thedifferenceHyabmetric function.tailwindas thecollectionparameter.numparameter is more than 1, the returned collection of colors has the colors sorted starting with the nearest color first