# @chriscodesthings/basic-color-types

> Defines named types for common color formats

Latest version **1.0.1** (published 2024-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chriscodesthings/basic-color-types
pnpm add @chriscodesthings/basic-color-types
yarn add @chriscodesthings/basic-color-types
bun add @chriscodesthings/basic-color-types
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-05-12 |
| First published | 2024-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Dabrowa |
| Maintainers | chriscodesthings |
| Keywords | jsdoc, typescript, color, type, definition, css, rgb, rgba |

## Links

- npm: https://www.npmjs.com/package/@chriscodesthings/basic-color-types
- Repository: https://github.com/ChrisCodesThings/basic-color-types
- Homepage: https://github.com/ChrisCodesThings/basic-color-types#readme
- Issues: https://github.com/ChrisCodesThings/basic-color-types/issues
- npm.io page: https://npm.io/package/@chriscodesthings/basic-color-types

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2024-05-12
- 1.0.0 — 2024-05-11

## README

# basic-color-types <br> [![NPM Version](https://img.shields.io/npm/v/@chriscodesthings/basic-color-types)](https://www.npmjs.com/package/@chriscodesthings/basic-color-types) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

> **Defines named types for common color formats**

## Description

Provides named types for common color formats.

### See...
- [Install](#install "Install")
- [Types](#types "Types")
- [See Also](#see-also "See Also")

---

## Install

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

## Types

These types are made available:

```ts
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:

```js
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:

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

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

## See Also...

- [**color-object**: Simple, lightweight class to store and manipulate a color, and convert between formats](https://github.com/ChrisCodesThings/color-object "Simple, lightweight class to store and manipulate a color, and convert between formats")
- [**is-css-hex-color**: Determine if a string is a CSS hex color code](https://github.com/ChrisCodesThings/is-css-hex-color "Determine if a string is a CSS hex color code")
- [**color-looks-like-rgba**: Determine if a set of values could be an RGB or RGBA color](https://github.com/ChrisCodesThings/color-looks-like-rgba "Determine if a set of values could be an RGB or RGBA color")

---
_Source: https://npm.io/package/@chriscodesthings/basic-color-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
