Skip to content

Commit

Permalink
docs(color): add notes about normalized hue range
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 1, 2023
1 parent cda14bf commit 733c3b4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/color/src/hcy/hcy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export declare class HCY implements TypedColor<HCY> {
toJSON(): number[];
}

/**
* @remarks
* Note: As with other hue-based color modes in this package, the hue is stored
* normalized (in [0..1] interval) and NOT as degrees.
*/
export const hcy = <ColorFactory<HCY>>defColor({
mode: "hcy",
channels: { h: { hue: true } },
Expand Down
5 changes: 5 additions & 0 deletions packages/color/src/hsi/hsi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export declare class HSI implements TypedColor<HSI> {
toJSON(): number[];
}

/**
* @remarks
* Note: As with other hue-based color modes in this package, the hue is stored
* normalized (in [0..1] interval) and NOT as degrees.
*/
export const hsi = <ColorFactory<HSI>>defColor({
mode: "hsi",
channels: { h: { hue: true } },
Expand Down
5 changes: 5 additions & 0 deletions packages/color/src/hsl/hsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export declare class HSL implements TypedColor<HSL> {
toJSON(): number[];
}

/**
* @remarks
* Note: As with other hue-based color modes in this package, the hue is stored
* normalized (in [0..1] interval) and NOT as degrees.
*/
export const hsl = <ColorFactory<HSL>>defColor({
mode: "hsl",
channels: { h: { hue: true } },
Expand Down
5 changes: 5 additions & 0 deletions packages/color/src/hsv/hsv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export declare class HSV implements TypedColor<HSV> {
toJSON(): number[];
}

/**
* @remarks
* Note: As with other hue-based color modes in this package, the hue is stored
* normalized (in [0..1] interval) and NOT as degrees.
*/
export const hsv = <ColorFactory<HSV>>defColor({
mode: "hsv",
channels: { h: { hue: true } },
Expand Down
6 changes: 5 additions & 1 deletion packages/color/src/lch/lch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export declare class LCH implements TypedColor<LCH> {

/**
* Luminance Chroma Hue (conversions assume {@link D50} white point, as per CSS
* spec).
* spec). Polar version of {@link labD50}.
*
* @remarks
* Note: As with other hue-based color modes in this package, the hue is stored
* normalized (in [0..1] interval) and NOT as degrees.
*/
export const lch = <ColorFactory<LCH>>defColor({
mode: "lch",
Expand Down

0 comments on commit 733c3b4

Please sign in to comment.