Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Fix alpha didn't changed (#597)

Ivan Starkov5d9f8c68b171
diff --git a/apps/designer/app/designer/features/style-panel/shared/color-picker.tsx b/apps/designer/app/designer/features/style-panel/shared/color-picker.tsx
index 41afb2c69d..1ebd2f60ee 100644
--- a/apps/designer/app/designer/features/style-panel/shared/color-picker.tsx
+++ b/apps/designer/app/designer/features/style-panel/shared/color-picker.tsx
@@ -45,7 +45,16 @@ const colorResultToRgbValue = (rgb: RgbaColor | RGBColor): RgbValue => {
r: rgb.r,
g: rgb.g,
b: rgb.b,
- alpha: rgb.a ?? 100,
+ alpha: rgb.a ?? 1,
+ };
+};
+
+const rgbValueToRgbColor = (rgb: RgbValue): RGBColor => {
+ return {
+ r: rgb.r,
+ g: rgb.g,
+ b: rgb.b,
+ a: rgb.alpha,
};
};
@@ -108,7 +117,7 @@ export const ColorPicker = ({
};
const stringValue = intermediateValue?.stringValue ?? toValue(value);
- const rgbValue = intermediateValue?.rgbValue ?? value;
+ const rgbValue = intermediateValue?.rgbValue ?? rgbValueToRgbColor(value);
const prefix = (
<Popover