feat: Improved scrolling and fixed identifying contrast on custom colors, b=bug #9185, c=common, workspaces

This commit is contained in:
mr. m
2025-06-26 21:03:41 +02:00
parent f0169277a0
commit 51d4396088
6 changed files with 66 additions and 33 deletions

View File

@@ -1253,7 +1253,11 @@
};
getMostDominantColor(allColors) {
return this.getPrimaryColor(allColors);
const color = this.getPrimaryColor(allColors);
if (typeof color === 'string') {
return this.hexToRgb(color);
}
return color;
}
blendColors(rgb1, rgb2, percentage) {
@@ -1629,8 +1633,8 @@
const gradient = this.getGradient(workspace.theme.gradientColors);
this.currentOpacity = previousOpacity;
this.#currentLightness = previousLightness;
this.#gradientsCache[uuid] = gradient;
return gradient;
this.#gradientsCache[uuid] = [gradient, workspace.theme.texture ?? 0];
return this.#gradientsCache[uuid];
}
}