diff options
| author | jules <jules@okfoc.us> | 2014-01-07 00:09:50 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-01-07 00:09:50 -0500 |
| commit | 981269960b6d8ce4b8c6e4da7f5979e2f7eea231 (patch) | |
| tree | 60d3d3b8d9d227a7b2340390a95b6e2cf00a1bf2 | |
| parent | 7d4ab95905b095b60a1fc0fcae7ba250705622cf (diff) | |
black() white() red()
| -rw-r--r-- | instructions.html | 7 | ||||
| -rw-r--r-- | js/color.js | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/instructions.html b/instructions.html index 32474cf..ef84503 100644 --- a/instructions.html +++ b/instructions.html @@ -40,8 +40,11 @@ rand(n), randint(n) choice(array) deg(radians), rad(degrees) -<u>color functions</u> -rgb(x,y,z) (setter) +<u>set pixel color</u> +rgb(r,g,b) +black() white() red() + +<u>color spaces</u> rgb2xyz(rgb) xyz2rgb(xyz) xyz2hunterlab(xyz) diff --git a/js/color.js b/js/color.js index 34404cd..d51bb67 100644 --- a/js/color.js +++ b/js/color.js @@ -4,6 +4,9 @@ function rgb(x,y,z){ if (x.length) { r=x[0]; g=x[1]; b =x[2]; } else { r=x; g=y; b=z } } +function black(){ rgb(0,0,0) } +function white(){ rgb(255,255,255) } +function red(){ rgb(255,0,0) } function rgb2xyz(rgb){ var var_R = ( rgb[0] / 255 ) //R from 0 to 255 |
