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

1.0.1 • Public • Published

basic-color-types
NPM Version License: MIT

Defines named types for common color formats

Description

Provides named types for common color formats.

See...


Install

npm install --save @chriscodesthings/basic-color-types

Types

These types are made available:

export type cssHexCode = string;
export type rgbColor = [number, number, number];
export type rgbaColor = [number, number, number, number];

TypeScript

To use the types in your TypeScript project:

import type { rgbColor } from '@chriscodesthings/basic-color-types';

const myColor: rgbColor = [100, 149, 237];

JavaScript

You can also use types in JavaScript with JSDoc with @typedef imports:

/**
 * @typedef {import('@chriscodesthings/basic-color-types').rgbaColor} rgbaColor
 */

/** @type {rgbaColor} */
const myColor = [100, 149, 237, 1];

See Also...

Package Sidebar

Install

npm i @chriscodesthings/basic-color-types

Weekly Downloads

7

Version

1.0.1

License

MIT

Unpacked Size

5.74 kB

Total Files

8

Last publish

Collaborators

  • chriscodesthings