DataDescription

Summary: _typescript_

Reviewed By: danielbuechele

Differential Revision: D17174253

fbshipit-source-id: d2ad87954a4fe49626f35234c2a9db180093fc54
This commit is contained in:
Chaiwat Ekkaewnumchai
2019-09-05 03:24:04 -07:00
committed by Facebook Github Bot
parent d7814b19da
commit f4bb0f987f
3 changed files with 24 additions and 2 deletions

View File

@@ -341,7 +341,21 @@ class ColorEditor extends Component<{
colors.pink,
colors.grape,
]}
onChange={this.onChange}
onChange={(color: {
hex: string;
hsl: {
a?: number;
h: number;
l: number;
s: number;
};
rgb: {a?: number; b: number; g: number; r: number};
}) => {
this.onChange({
hex: color.hex,
rgb: {...color.rgb, a: color.rgb.a || 1},
});
}}
/>
</Popover>
</ColorPickerDescription>
@@ -432,7 +446,7 @@ function parseColor(
// extract alpha if passed AARRGGBB
if (val.length === 8) {
a = parseInt(parts.shift(), 16) / 255;
a = parseInt(parts.shift() || '0', 16) / 255;
}
const size = val.length;