Installation
npm install --save @types/color-rgba
Summary
This package contains type definitions for color-rgba (https://github.com/colorjs/color-rgba#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-rgba.
index.d.ts
/**
* Returns channels values as they are in the input color string argument.
* `alpha` is always from 0..1 range.
* `color` can be a CSS color string,
* an array with channel values, an object etc.,
*/
declare function rgba(string: ColorValue): [number, number, number, number] | undefined;
type ColorValue = string | RGBTuple | RGBColor | RGBKeyedColor | HSL;
type RGBTuple = [number, number, number];
interface RGBColor {
r: number;
g: number;
b: number;
}
interface RGBKeyedColor {
red: number;
green: number;
blue: number;
}
interface HSL {
h: number;
s: number;
l: number;
}
/**
* Color string parser
*/
export = rgba;
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by Piotr Błażejewicz.