mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-26 11:52:54 +00:00
12 lines
264 B
JavaScript
12 lines
264 B
JavaScript
![]() |
.pragma library
|
||
|
|
||
|
function setAlphaF(solidColor, alpha) {
|
||
|
var solid = String(solidColor);
|
||
|
var alphaHex = Math.round(alpha * 255).toString(16);
|
||
|
|
||
|
if (alphaHex.length === 1)
|
||
|
alphaHex = "0" + alphaHex;
|
||
|
|
||
|
return "#" + alphaHex + solid.slice(1);
|
||
|
}
|