I have many such conditions in my codes: (conditions based on the color of the element)
if ( $(elmnt).css("color") == "rgb(134, 134, 134)" ) { // do stuff }
I recently heard:
relies on the color element incorrectly. Because different browsers return a different color. How:rgb (0,0,0)#000000black
relies on the color element incorrectly. Because different browsers return a different color. How:
rgb (0,0,0)
#000000
black
It's true? anyway, as I said, I have a lot of conditions in my JS code, as described above, and now I do not know what to do. Any suggestion?
Note. Changing all of these conditions in my codes seems like a nightmare.:-(
:-(
You can use this RGB parser for JavaScript:
http://www.phpied.com/rgb-color-parser-in-javascript/
( ):
var color = new RGBColor('darkblue'); if (color.ok) { // 'ok' is true when the parsing was a success // alert channels alert(color.r + ', ' + color.g + ', ' + color.b); // alert HEX and RGB alert(color.toHex()); alert(color.toRGB()); }
- , , , . CSS-, , , , , .
, , , , .
, JavaScript- , , , , , , .
-, , - :
- , , . , .
"", , , .
getBooks(), , : " !" , - , .
getBooks()
, ? , , , ... , , - , , getBooks(), , , , , .
, , - " ", " " " ". NPC MMO - , , , , , . , , , , , .
Source: https://habr.com/ru/post/1655675/More articles:What is RESTful way to query with filters? - restПеременная CMake с ограниченными действительными значениями - buildJava - How to create an alternating triangular pyramid? - javaHow to enter a tilde in formulas in RMarkdown - rAppEngine / Datastore: the best way to get as ancestor's request returns everything recursively - google-app-engineThe setTimeout () function is called twice in a string - javascriptC # encoded serial output - c #Bokeh: отображение изображений с помощью Hovertool - pythonUsing a Form with a Dynamic Input List Template (ngFor) - angularКакой правильный способ найти все объекты, упорядоченные по полю в Spring Data? - javaAll Articles