New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for colours with alpha values. #5
Conversation
@maxs15 Since the change is so minor I'm hoping this can be merged fairly quickly. |
hey @mpretty-homepass, |
@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.. |
Added support for colours with alpha values.
@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 :) |
Awesome, thanks for that :) |
Added support for colours with alpha values.
Currently if you set a colour with a hex value it will display the wrong colour, this adds support for colours with alpha values.