Socket
Socket
Sign inDemoInstall

@types/color-name

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/color-name

TypeScript definitions for color-name


Version published
Weekly downloads
1.7M
decreased by-22.41%
Maintainers
1
Weekly downloads
 
Created

What is @types/color-name?

@types/color-name is a TypeScript type definition package for the color-name library. The color-name library provides a mapping of color names to their RGB values. This package allows TypeScript developers to use the color-name library with type safety.

What are @types/color-name's main functionalities?

Color Name to RGB Mapping

This feature allows you to get the RGB values of a color by its name. For example, you can get the RGB values for 'red' which are [255, 0, 0].

const colorName = require('color-name');
const redRGB = colorName.red;
console.log(redRGB); // Output: [255, 0, 0]

Type Safety with TypeScript

This feature provides type definitions for the color-name library, ensuring type safety when using TypeScript. For example, you can get the RGB values for 'blue' with type safety.

import colorName from 'color-name';
const blueRGB: [number, number, number] = colorName.blue;
console.log(blueRGB); // Output: [0, 0, 255]

Other packages similar to @types/color-name

FAQs

Package last updated on 13 Feb 2019

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