Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[google_maps_flutter] Support Color's alpha channel when converting to UIColor on iOS #1549

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

matthewlloyd
Copy link
Contributor

Description

Support Color's alpha channel when converting to UIColor on iOS. This allows polylines and other overlays to be added in the future (e.g. circles and polygons) to be translucent, to match the behavior on Android.

Tested manually using a translucent polyline in the iOS simulator.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

return [UIColor colorWithRed:((float)((value & 0xFF0000) >> 16)) / 255.0
green:((float)((value & 0xFF00) >> 8)) / 255.0
blue:((float)(value & 0xFF)) / 255.0
alpha:1.0];
alpha:((float)((value & 0xFF000000) >> 24)) / 255.0];
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this change affect people who are already using some color. Since it's signed i'm guessing value & 0xFF000000 will default to FF which should still retain the existing semantics of alpha being 1.0. Could you confirm that behavior for me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it will retain the existing semantics. The alpha channel already works on Android, so users are presumably already using Colors with the alpha channel set to FF, and this will just evaluate to alpha: 1.0.

Copy link
Contributor

@iskakaushik iskakaushik left a comment

Choose a reason for hiding this comment

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

LGTM

@iskakaushik iskakaushik merged commit 31038b9 into flutter:master Apr 29, 2019
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
…tter#1549)

* Added Apple auth provider

Co-Authored-By: Collin Jackson <jackson@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants