We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93da80d commit 5a3e5b7Copy full SHA for 5a3e5b7
src/components/widgets/ColorPicker.js
@@ -108,7 +108,12 @@ class ColorPicker extends Component {
108
// expect from user data.
109
const selectedColor = tinycolor(this.props.selectedColor);
110
const colorText = selectedColor.toHexString();
111
- const rgbString = selectedColor.toRgbString();
+
112
+ // Convert rgba to rgb if necessary
113
+ const rgbString =
114
+ selectedColor._a !== 0
115
+ ? selectedColor.toRgbString()
116
+ : `rgb(${selectedColor._r},${selectedColor._g},${selectedColor._b})`;
117
118
// We need inline style here to assign the background color
119
// dynamically.
0 commit comments