MCPcopy
hub / github.com/omgovich/colord / saturate

Function saturate

src/manipulate/saturate.ts:5–14  ·  view source on GitHub ↗
(rgba: RgbaColor, amount: number)

Source from the content-addressed store, hash-verified

3import { clamp } from "../helpers";
4
5export const saturate = (rgba: RgbaColor, amount: number): HslaColor => {
6 const hsla = rgbaToHsla(rgba);
7
8 return {
9 h: hsla.h,
10 s: clamp(hsla.s + amount * 100, 0, 100),
11 l: hsla.l,
12 a: hsla.a,
13 };
14};

Callers 3

saturateMethod · 0.90
desaturateMethod · 0.90
grayscaleMethod · 0.90

Calls 2

rgbaToHslaFunction · 0.90
clampFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…