@types/color-string
TypeScript icon, indicating that this package has built-in type declarations

1.5.5 • Public • Published

Installation

npm install --save @types/color-string

Summary

This package contains type definitions for color-string (https://github.com/qix-/color-string#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-string.

index.d.ts

export type Color = [number, number, number, number];

export interface ColorDescriptor {
    model: "rgb" | "hsl" | "hwb";
    value: Color;
}

export function get(colorString: string): ColorDescriptor | null;

export namespace get {
    function hsl<TColorStr extends string | null>(colorString: TColorStr): TColorStr extends string ? Color : null;
    function hwb<TColorStr extends string | null>(colorString: TColorStr): TColorStr extends string ? Color : null;
    function rgb<TColorStr extends string | null>(colorString: TColorStr): TColorStr extends string ? Color : null;
}

export namespace to {
    function hex(...args: Array<number | number[]>): string;
    function rgb(...args: Array<number | number[]>): string;
    namespace rgb {
        function percent(...args: Array<number | number[]>): string;
    }
    function keyword(...args: Array<number | number[]>): string;
    function hsl(...args: Array<number | number[]>): string;
    function hwb(...args: Array<number | number[]>): string;
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender, Dan Marshall, and Eric NICOLAS (ccjmne).

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @types/color-string

      Weekly Downloads

      41,205

      Version

      1.5.5

      License

      MIT

      Unpacked Size

      5.02 kB

      Total Files

      5

      Last publish

      Collaborators

      • types