Closed mpretty-cyro closed 8 years ago
@maxs15 Since the change is so minor I'm hoping this can be merged fairly quickly.
hey @mpretty-homepass, Why didn't you use the style opacity property ?
@maxs15 When it comes to animations or general opacity then I probably would use the style's opacity property, but the case I'm using is applying a global theme which may actually include the opacity in the hex value (having to pass through multiple values to define a global 'primary colour' would be inconvenient).
You could also just ignore the opacity in the hex (currently if you pass it through it will render as an incorrect colour which I initially thought was a bug before I looked in to what it was doing) - this way when a user passes through a hex value which includes opacity, it should be fairly obvious that the opacity part is being ignored.
Ok fair reason, I was just curious.. I'll merge your PR, thanks for the contribution
@maxs15 No problem, you have every right to ask why. Here is an example of an issue I ran in to the first time I used SpinKit - I set a primary theme colour of '#4D9E02FF' (it enforces no opacity on the colour) and the following occurred:
Whereas the colour should be:
Just want to ensure users don't run in to the same issue in the future. Another expansion to this would probably be to add support for 3 char hex values (ie. '#F11' becomes '#F11F11'), since it is supported by React Native.
I see the issue, thanks for this nice and colorful explanation, if you need any further enhancements I'll always accept any PR :) Your fix is now available in the new version 0.0.7 !
Awesome, thanks for that :)
Currently if you set a colour with a hex value it will display the wrong colour, this adds support for colours with alpha values.