Skip to content

Conversation

@alexbrault
Copy link
Contributor

This PR adds a color option to tint an ol.style.Icon.

See https://groups.google.com/forum/#!topic/ol3-dev/vPK4ygQHaqo

@alexbrault
Copy link
Contributor Author

@ahocevar, I ended up multiplying pixel values instead of replacing white with the colour because the latter left undesired artifacts in the majority of cases (e.g. anything with antialiasing)

@ahocevar
Copy link
Member

Thanks for this pull request @alexbrault. Great enhancement! I'll review it within the next few days.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applying the color will only work if the image is not tainted.
It should be moved after determineTainting().

@alexbrault alexbrault force-pushed the colour-icon branch 4 times, most recently from 06a5230 to 28633e4 Compare November 25, 2015 02:02
externs/olx.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to also accept a string here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget what my reasoning for omitting this was, but yes, it should

@fredj fredj added this to the v3.13.0 milestone Jan 7, 2016
@ahocevar
Copy link
Member

ahocevar commented Jan 8, 2016

This looks great @alexbrault. It looks like we do not have a CLA on file from you yet. Can you please submit one so we can merge this?

ahocevar added a commit to openlayers/cla that referenced this pull request Jan 10, 2016
Thanks @alexbrault for openlayers/openlayers#4457 and any future contributions you can make.
ahocevar added a commit that referenced this pull request Jan 10, 2016
Add color option to ol.style.Icon
@ahocevar ahocevar merged commit d05b519 into openlayers:master Jan 10, 2016
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nicer to have a dedicated example that shows what this option should be used for. We have a bad tendency to continue modifying examples that started out simple until they become overly complex (or just ugly). And I think this particular example looked nicer before the color option was added (same goes for opacity).

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll submit a PR to fork the example

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants