Open egazarian opened 2 years ago
I don't think this is a bug. You can also enter text in the color picker to get a color. The argument type used to be Color
though instead of ColorValue
Ok, I got it. And yes, it would be better to have an argument of type Color
, instead of ColorValue
. In this way we should be able to get the color as any format.
Version
typescript: 4.1.2 mui-color: 2.0.0-beta.2 @mui/material: 5.0.4 react: 17.0.2 @emotion/react: 11.5.0 @emotion/styled: 11.3.0
Issue
When trying to access to the hex value of a ColorValue inside of ColorPicker onChange event handler, typescript throw Property 'hex' does not exist on type 'ColorValue'. Same issue for all the properties of ColorValue object.
Screenshot
Workaround
Should the onChange handler argument type be ColorObject instead of ColorValue ?