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
Handle semi-transparency in canvas icon-src
/icon-color
and fill-pattern-src
/fill-color
combinations
#15295
base: main
Are you sure you want to change the base?
Conversation
📦 Preview the website for this branch here: https://deploy-preview-15295--ol-site.netlify.app/. |
The icon already accepts an |
Opacity is an updateable setting for all ol/style/Image subclasses (which might also have alpha in their fill or stroke) and is handled by the canvas layer renderer, while Applying an opacity in addition to a color with alpha appears to give consistent results for canvas and WebGL in the test setup, i.e. Due to the need to handle semi-transparency in the original image, all of this change apart from the single line |
I have checked how well outputs from canvas and WebGL match in a setup similar to the rendering test, and with various combinations of It is apparent that using 0.5 twice in those situations can produce more differences than using 0.25 once - this is because there is no such thing as a 0.5 alpha, it is either 127/255 or 128/255 - and using those together will produce a better match. However specifying 127/255 as alpha for an |
icon-color
alpha handlingicon-src
/icon-color
and fill-pattern-src
/fill-color
combinations
The IE fallback removed in #13912 always worked correctly, and was probably faster even without the additional |
📦 Preview the website for this branch here: https://deploy-preview-15295--ol-site.netlify.app/. |
Fixes #15290
Fixes #15318 (comment)
Makes the handling of alpha in
icon-color
and icons in IconImage consistent with WebGL