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

2.1.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/color-rgba

Weekly Downloads

7,481

Version

2.1.2

License

MIT

Unpacked Size

3.93 kB

Total Files

5

Last publish

Collaborators

  • types