Open anthonyryanrusso opened 4 years ago
You could listen for the change
event, check if the color has an alpha value and change the representation with setColorRepresentation
to RGBA
It means:
// pickr is your instance.
pickr.on('change', function( color ) {
if ( color.a === 1 ) {
pickr.setColorRepresentation('HEX');
} else {
pickr.setColorRepresentation('RGBA');
}
});
Is it possible for a the picker to start with a hex value and then change to rgba when the alpha is changed?
E.g. the pickr starts off as #ffffff but the alpha is changed to .8 so now the pickr displays it as rgba(255, 255, 255, .8)