@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).

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.5.532,076ts5.6
1.5.532,076latest
1.5.532,076ts4.5
1.5.532,076ts4.6
1.5.532,076ts4.7
1.5.532,076ts4.8
1.5.532,076ts4.9
1.5.532,076ts5.0
1.5.532,076ts5.1
1.5.532,076ts5.2
1.5.532,076ts5.3
1.5.532,076ts5.4
1.5.532,076ts5.5
1.5.532,076ts5.7
1.5.24,406ts3.8
1.5.24,406ts3.9
1.5.24,406ts4.0
1.5.24,406ts4.1
1.5.24,406ts4.2
1.5.01,708ts2.0
1.5.01,708ts2.1
1.5.01,708ts2.2
1.5.01,708ts2.3
1.5.01,708ts2.4
1.5.01,708ts2.5
1.5.01,708ts2.6
1.5.01,708ts2.7
1.5.01,708ts2.8
1.5.01,708ts2.9
1.5.01,708ts3.0
1.5.01,708ts3.1
1.5.01,708ts3.2
1.5.01,708ts3.3
1.5.01,708ts3.4
1.5.01,708ts3.5
1.5.01,708ts3.6
1.5.01,708ts3.7
1.5.3799ts4.3
1.5.3799ts4.4

Version History

VersionDownloads (Last 7 Days)Published
1.5.532,076
1.5.461
1.5.3799
1.5.24,406
1.5.11
1.5.01,708

Package Sidebar

Install

npm i @types/color-string

Weekly Downloads

39,051

Version

1.5.5

License

MIT

Unpacked Size

5.02 kB

Total Files

5

Last publish

Collaborators

  • types