Skip to content
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

Gradients #1

Closed
artemnovichkov opened this issue Feb 23, 2018 · 2 comments
Closed

Gradients #1

artemnovichkov opened this issue Feb 23, 2018 · 2 comments
Labels
🚀 enhancement New feature or request

Comments

@artemnovichkov
Copy link
Owner

artemnovichkov commented Feb 23, 2018

Add Swift code snippet for gradients:

Don’t forget about angular and radial gradients.
@artemnovichkov artemnovichkov added the 🚀 enhancement New feature or request label Feb 23, 2018
@ignatovSA
Copy link
Contributor

ignatovSA commented Mar 3, 2018

Beware while using CAGradientLayer, this may lead to results that differ from Zeplin mockups, when using inclined gradients

The problem is described on medium and stackoverflow

Instead of using 'right' coefficients like proposed above, a solution with custom CALayer subclass could be applied. The magic is in overriding draw(in ctx: CGContext) function. Sample implementation gist

image

@artemnovichkov
Copy link
Owner Author

Thanks a lot, @ignatovSA! I have read the article on Medium and know about this problem. That's why the feature still in WIP status. Your example looks clear and laconic. Do you want to send a PR? It would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants