closest-css-color

1.0.0 • Public • Published

closest-css-color

Find the closest CSS color keyword for a given hex color value.

npm version Build status License Contact me

Installation

npm install --save closest-css-color

closestColor(hex, { detailed = false }})

const closestColor = require('closest-css-color')

// normal usage
const color = closestColor('#a00a0a')
console.log(simpleColor)
// -> 'darkred'

// with the `detailed` option
const colorWithAdditionalInformation = closestColor('#1019a6', { detailed: true })
console.log(detailedColor)
// -> {
//     name: 'darkblue',
//     hex: '#00008b',
//     rgb: {red: 0, green: 0, blue: 139}
// }

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2
  • 0.1.1
    0
  • 0.1.0
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i closest-css-color

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

4.01 kB

Total Files

5

Last publish

Collaborators

  • juliuste