daattali / colourpicker

🎨 A colour picker tool for Shiny and for selecting colours in plots (in R)
https://daattali.com/shiny/colourInput/
Other
217 stars 28 forks source link

Alpha feature: make it work with colourWidget() and plotHelper() #13

Closed daattali closed 7 years ago

daattali commented 7 years ago

Currently colourWidget() is visually broken since the alpha addition:

image

Because the checkered image is in the DOM above the input, when the input is not 100% width then the checkered image goes too far. Either need to fix the HTML generated from colourWidget(), or to change the way the background image is generated in the JS code itself.

The first option is much much simpler. However, the second option may also fix other potential future problems, such as if someone manually changes the width of the input field or changes the border-radius of the input field, the background image will need to be corrected. The second option of fixing it in the javascript library can be achieved using this simple technique (using both a background-image and a box-shadow with inset on the input field, instead of using a wrapper around the input field only for the image)

Also need to fix plotHelper() and colourPicker() addins to work with the alpha feature

@DavidRGriswold

daattali commented 7 years ago

this now works in the feature/alpha branch