JSPM

@types/color-rgba

2.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3174
  • Score
    100M100P100Q120156F
  • License MIT

TypeScript definitions for color-rgba

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/color-rgba) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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] | [];
    
    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: Thu, 18 Jul 2024 07:35:50 GMT
    • Dependencies: none

    Credits

    These definitions were written by Piotr Błażejewicz.