aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
654 stars 201 forks source link

CSS color names appear as black in ColorWidget #404

Closed jsantell closed 7 years ago

jsantell commented 7 years ago

When setting a color property to a CSS color like 'white' or 'orange', the color widget displays it as black. The widget handles converting from the short hand hex variant #333, but does not handle color names, or HSL values.

I can write a quick patch for this, but wondering what's more desirable -- using a lib like color-string (+14kb unminified, +500b minified), or putting the supplied color value into a div and using window.getComputedStyle and converting by hand the supplied HSL values. Both methods should handle any color format.