Skip to content

Commit efe0fd1

Browse files
committed
Move color constants documentation to color module
1 parent dfb2eab commit efe0fd1

File tree

2 files changed

+54
-33
lines changed

2 files changed

+54
-33
lines changed

src/color/creating_reading.js

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,69 @@
88

99
import { Color } from './p5.Color';
1010

11+
/**
12+
* @typedef {'rgb'} RGB
13+
* @property {RGB} RGB
14+
* @final
15+
*/
1116
export const RGB = 'rgb';
17+
/**
18+
* @typedef {'rgbhdr'} RGBHDR
19+
* @property {RGBHDR} RGBHDR
20+
* @final
21+
*/
1222
export const RGBHDR = 'rgbhdr';
23+
/**
24+
* HSB (hue, saturation, brightness) is a type of color model.
25+
* You can learn more about it at
26+
* <a href="https://learnui.design/blog/the-hsb-color-system-practicioners-primer.html">HSB</a>.
27+
*
28+
* @typedef {'hsb'} HSB
29+
* @property {HSB} HSB
30+
* @final
31+
*/
1332
export const HSB = 'hsb';
33+
/**
34+
* @typedef {'hsl'} HSL
35+
* @property {HSL} HSL
36+
* @final
37+
*/
1438
export const HSL = 'hsl';
39+
/**
40+
* @typedef {'hwb'} HWB
41+
* @property {HWB} HWB
42+
* @final
43+
*/
1544
export const HWB = 'hwb';
16-
45+
/**
46+
* @typedef {'lab'} LAB
47+
* @property {LAB} LAB
48+
* @final
49+
*/
1750
export const LAB = 'lab';
51+
/**
52+
* @typedef {'lch'} LCH
53+
* @property {LCH} LCH
54+
* @final
55+
*/
1856
export const LCH = 'lch';
19-
57+
/**
58+
* @typedef {'oklab'} OKLAB
59+
* @property {OKLAB} OKLAB
60+
* @final
61+
*/
2062
export const OKLAB = 'oklab';
63+
/**
64+
* @typedef {'oklch'} OKLCH
65+
* @property {OKLCH} OKLCH
66+
* @final
67+
*/
2168
export const OKLCH = 'oklch';
22-
69+
/**
70+
* @typedef {'rgba'} RGBA
71+
* @property {RGBA} RGBA
72+
* @final
73+
*/
2374
export const RGBA = 'rgba';
2475

2576
function creatingReading(p5, fn){

src/core/constants.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -838,36 +838,6 @@ export const BEVEL = 'bevel';
838838
*/
839839
export const MITER = 'miter';
840840

841-
// COLOR
842-
/**
843-
* @typedef {'rgb'} RGB
844-
* @property {RGB} RGB
845-
* @final
846-
*/
847-
// export const RGB = 'rgb';
848-
/**
849-
* HSB (hue, saturation, brightness) is a type of color model.
850-
* You can learn more about it at
851-
* <a href="https://learnui.design/blog/the-hsb-color-system-practicioners-primer.html">HSB</a>.
852-
*
853-
* @typedef {'hsb'} HSB
854-
* @property {HSB} HSB
855-
* @final
856-
*/
857-
// export const HSB = 'hsb';
858-
/**
859-
* @typedef {'hsl'} HSL
860-
* @property {HSL} HSL
861-
* @final
862-
*/
863-
// export const HSL = 'hsl';
864-
/**
865-
* @typedef {'rgba'} RGBA
866-
* @property {RGBA} RGBA
867-
* @final
868-
*/
869-
// export const RGBA = 'rgba';
870-
871841
// DOM EXTENSION
872842
/**
873843
* AUTO allows us to automatically set the width or height of an element (but not both),

0 commit comments

Comments
 (0)