xiaokaike / vue-color

:art: Vue Color Pickers for Sketch, Photoshop, Chrome & more http://vue-color.surge.sh
https://xiaokaike.github.io/vue-color/
MIT License
2.54k stars 355 forks source link

Auto detect fieldsIndex based on input color format #221

Open olemarius opened 3 years ago

olemarius commented 3 years ago

In Chrome component, the fieldsIndex is set to 0 (hex) by default, so when the initial value is not hex it'll still show hex input in the colorpicker.

I'd like to request the following feature: :formats="['hex','rgb','hsl']" lists which format should be available :format="rgba" will set fieldIndex to the desired color format :detectFormat="true" will auto detect format. If value is empty, fall back on :format forceFormat="true"will take the input format and convert to :format

This feature gives better control of the input/output