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

Specify color space when generating gradient #6

Open
Thomasch opened this issue Oct 2, 2018 · 1 comment
Open

Specify color space when generating gradient #6

Thomasch opened this issue Oct 2, 2018 · 1 comment

Comments

@Thomasch
Copy link

Thomasch commented Oct 2, 2018

When I changed to use P3 wide colors in our app, I noticed that the gradients didn't use that color space.

I looked through the code and saw that MKGradientGenerator uses CGColorSpaceCreateDeviceRGB. I changed that to CGColorSpace(name: CGColorSpace.displayP3) and the gradient was displaying in P3.

Maybe you can add a parameter (with default value) or get the color space from the start/end color?

Thanks!

@maxkonovalov
Copy link
Owner

@Thomasch wide colors are not really supported by the lib at the moment and all color components are clipped to [0.0, 1.0] range. So I think it makes no sense to add P3 color space support just yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants