Socket
Socket
Sign inDemoInstall

closest-css-color

Package Overview
Dependencies
5
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    closest-css-color

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


Version published
Weekly downloads
48
increased by4700%
Maintainers
1
Install size
1.51 MB
Created
Weekly downloads
 

Changelog

Source

1.0.0

  • BREAKING: node >=14
  • upgrade and reduce dependencies

Readme

Source

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.

Keywords

FAQs

Last updated on 31 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc