Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

color-groups

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-groups

Find and display HTML colors by group.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by133.33%
Maintainers
1
Weekly downloads
 
Created
Source

color-groups

Build Status npm version codecov Mutation testing badge

Find and display HTML colors by group or find the primary color that any named color belongs to.

Based on W3C named colors.

Install

$ npm install color-groups

Usage

const colorGroups = require('color-groups')

Find all the named colors that belong to one group.

const oranges = colorGroups.get.orange    // [ 'orange', 'darkorange', 'coral', 'tomato', 'orangered' ]

Find the main group that a named color belongs to.

const primary = colorGroups.find('papayawhip')    // 'yellow'

Find the main groups that many named colors belong to.

const myColors = ['palevioletred', 'lemonchiffon', 'cornsilk']

const primaries = myColors.map(color => colorGroups.find(color))    // [ 'pink', 'yellow', 'brown' ]

Authors

Tim Dunphy

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Keywords

FAQs

Package last updated on 20 Jul 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc