color-string

  • Version 2.0.1
  • Published
  • 10.7 kB
  • 1 dependency
  • MIT license

Install

npm i color-string
yarn add color-string
pnpm add color-string

Overview

Parser and generator for CSS color strings

Index

Variables

Type Aliases

Variables

variable colorString

const colorString: ColorString;

    Type Aliases

    type ColorString

    type ColorString = {
    get: {
    (color: string): { model: Model; value: number[] } | null;
    rgb: (color: string) => number[] | null;
    hsl: (color: string) => number[] | null;
    hwb: (color: string) => number[] | null;
    };
    to: {
    hex: (r: number, g: number, b: number, a?: number) => string | null;
    rgb: {
    (r: number, g: number, b: number, a?: number): string | null;
    percent: (r: number, g: number, b: number, a?: number) => string | null;
    };
    keyword: (r: number, g: number, b: number, a?: number) => string | null;
    hsl: (h: number, s: number, l: number, a?: number) => string | null;
    hwb: (h: number, w: number, b: number, a?: number) => string | null;
    };
    };

      type Model

      type Model = 'rgb' | 'hsl' | 'hwb';

        Package Files (1)

        Dependencies (1)

        Dev Dependencies (2)

        Peer Dependencies (0)

        No peer dependencies.

        Badge

        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/color-string.

        • Markdown
          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/color-string)
        • HTML
          <a href="https://www.jsdocs.io/package/color-string"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>