How to set background color via hsla using jquery.css ()?

I cannot force jQuery.css () to accept the value of hsla (). Isn't that an acceptable format for conveying color values? This is what I tried:

// the below variable outputs a variable value with the following format // hsla(131, 10%, 100%, 1.0) var finalcolor = "hsla(" +colx +", " +coly +"%, " +"100%, " +"1.0)"; $('#target-div').css('background', finalcolor); 
+4
source share
1 answer

It works, but your color is just white!

Check the resulting style in the firebug / chrome debugger and check the HSL 2 RGB converter. http://serennu.com/colour/hsltorgb.php

+4
source

Source: https://habr.com/ru/post/1432173/


All Articles