Skip to content

pantoken / plugins/pantoken/colors/src / darken

Fonksyon: darken()

darken(color, percent?): string

Beta

Fè pi fonse pa percent pwen HSL-limyè — vèsyon sèlman CSS ki matche ak ui-color-utils darken (tinycolor bese limyè HSL). Itilize sentaks koulè relatif pou kenbe ton ak saturasyon.

In relative hsl(), the l channel resolves to a <number> on the 0–100 scale — the same scale tinycolor's amount uses — so the points are subtracted directly (no %).

Paramèt

color

string

Koulè baz la.

percent?

number = 10

Pwen limyè pou soustrè (default 10, ki matche ak default tinycolor la).

Retounen

string

Yon hsl(from …) ekspresyon koulè relatif.

Egzanp

ts
darken("var(--brand)", 10); // "hsl(from var(--brand) h s calc(l - 10))"