With color picker http://labs.abeautifulsite.net/jquery-miniColors/, how can I limit the number of colors to just using the grayscale slider?
Asked
Active
Viewed 1,146 times
0
-
I am not sure I understand. Do you want to force your user to select a shade of gray or to limit the number of lightness levels the user can choose? The former can be done with some CSS, the latter needs a `change` callback. – John Dvorak Dec 29 '12 at 16:05
-
as an observation from the one given in the link.. it would seem that 'grayscale' would mean that the RGB would be equal? check this out http://stackoverflow.com/questions/835753/convert-grayscale-value-to-rgb-representation – ianace Dec 29 '12 at 16:36
-
Thanks for the reply, My intent is switch to grayscale and take the rgb value – ll.luca Dec 30 '12 at 13:54
-
the link you provide is not working for me – Evhz Apr 21 '16 at 02:04
1 Answers
0
In order to limit to greyscale values, the rgb model must be like:
x = [0, 255]
rgb(x, x, x)
For example:
.elem { background-color: rgb(122, 122, 122); }
or in hexadecimal, as css # notation, the values must follow:
x = [0, 9][a, f]
y = [0, 9][a, f]
#xyxyxy
For example:
.elem { background-color: #e1e1e1; }

Evhz
- 8,852
- 9
- 51
- 69