forked from Shinonome/dots-hyprland
fix stuff not getting blurred when transparency is enabled
This commit is contained in:
@@ -111,4 +111,17 @@ Singleton {
|
||||
var c = Qt.color(color);
|
||||
return Qt.rgba(c.r, c.g, c.b, c.a * (1 - percentage));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the alpha channel of a color.
|
||||
*
|
||||
* @param {string} color - The base color (any Qt.color-compatible string).
|
||||
* @param {number} alpha - The desired alpha (0-1).
|
||||
* @returns {Qt.rgba} The resulting color with applied alpha.
|
||||
*/
|
||||
function applyAlpha(color, alpha) {
|
||||
var c = Qt.color(color);
|
||||
var a = Math.max(0, Math.min(1, alpha));
|
||||
return Qt.rgba(c.r, c.g, c.b, a);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user