# @bam.tech/teinte

> A color interpolation library

Latest version **1.4.0** (published 2023-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bam.tech/teinte
pnpm add @bam.tech/teinte
yarn add @bam.tech/teinte
bun add @bam.tech/teinte
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2023-11-23 |
| First published | 2023-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 31 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | charlotteisambertbam, remilry, matthieugbam, hugok, pierrezimmermann, pierpo, alexisd, p0labrd, antoine-cottineau, laurence923, cyrilbo, clementtab, antoined, marekkalnik, almouro, tychota, julienc6, minishlink |
| Keywords | oklab, gamut, color, interpolation, interpolate, interpolati |

## Links

- npm: https://www.npmjs.com/package/@bam.tech/teinte
- npm.io page: https://npm.io/package/@bam.tech/teinte

## 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.4.0 (latest) — 2023-11-23
- 1.6.0-beta.1 (beta) — 2023-12-12
- 1.5.0-alpha.2 (alpha) — 2023-11-24
- 1.5.0-alpha.1 — 2023-11-23
- 1.5.0-alpha.0 — 2023-11-23
- 1.3.0 — 2023-10-30
- 1.2.1 — 2023-10-27
- 1.2.0 — 2023-10-27
- 1.1.0 — 2023-10-27
- 1.0.1 — 2023-10-20
- 1.0.0 — 2023-10-20
- 0.0.1 — 2023-10-20

## README

# Teinte

Teinte is a library to handle color interpolation.

Usage:

```ts
import { interpolateColor } from "@bam.tech/teinte";

const color1 = { r: 255, g: 0, b: 0 };
const color2 = { r: 0, g: 255, b: 0 };
const ratio = 0.5;
const colorspace = "oklab";
const gamutMapping = "adaptativeL05-5";

const color = interpolateColor(color1, color2, ratio, colorspace, gamutMapping);
```

Arguments are:
- color1: first RGB color
- color2: second RGB color
- ratio: interpolation ratio between 0 and 1
- colorspace: colorspace to use for interpolation. Can be "rgb" | "hsl" | "oklab" | "oklch". Is "oklab" by default
- gamutMapping: gamut mapping to use for interpolation. Can be "clamp" | "gray" | "preserveChroma" | "projectTo05" | "projectToLCusp" | "adaptativeL05-005" | "adaptativeL05-05" | "adaptativeL05-5" | "adaptativeLcusp-005" | "adaptativeLcusp-05" | "adaptativeLcusp-5"

See https://bottosson.github.io/posts/gamutclipping/ for more information about gamut mapping.


## Development

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.0.3. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

---
_Source: https://npm.io/package/@bam.tech/teinte · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
