diff options
| -rw-r--r-- | instructions.html | 1 | ||||
| -rw-r--r-- | js/color.js | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/instructions.html b/instructions.html index 4ff57e9..2767e48 100644 --- a/instructions.html +++ b/instructions.html @@ -44,6 +44,7 @@ deg(radians), rad(degrees) rgb(r,g,b) rgbref([rgb]) black() white() red() +gray(n) <u>color spaces</u> rgb2xyz(rgb) diff --git a/js/color.js b/js/color.js index da4f430..ba60db7 100644 --- a/js/color.js +++ b/js/color.js @@ -9,6 +9,7 @@ function rgbref(rgb){ function black(){ rgb(0,0,0) } function white(){ rgb(255,255,255) } function red(){ rgb(255,0,0) } +function gray(n){ n<1&&(n*=255);rgb(n,n,n) } function rgb2xyz(rgb){ var var_R = ( rgb[0] / 255 ) //R from 0 to 255 |
