Skip to main content
@MKAbuMattar/sptruz

@sptruz/color-name

https://sptruz.vercel.app/

@sptruz/color-name is a package for a list of color names.

Installation

Node/npm

#npm
npm install --save @sptruz/color-name

#yarn
yarn add @sptruz/color-name

#pnpm
pnpm add @sptruz/color-name

Deno

Unlike Node, Deno doesn’t use a package management like NPM and instead depends on direct URL imports. You can access @sptruz/color-name on deno.land/x. This is how the most recent version may be imported:

You can also specify a particular version:

import * as sptruzColorName from 'https://deno.land/x/sptruz_color_name@0.0.0-beta.0.0.2/mod.ts';

or letest version:

import * as sptruzColorName from 'https://deno.land/x/sptruz_color_name/mod.ts';

NOTE: There isn’t much of a change in how it’s used, but the remainder of this README assumes you’re using npm and importing straight from the @sptruz/color-name.

Basic usage

import sptruzColorName from '@sptruz/color-name';

(() => {
  const red = sptruzColorName.Red;

  console.log(red);

  // Output: { hex: '#ff0000', hsl: [ 0, 100, 50 ], rgb: [ 255, 0, 0 ] }
})();