Skip to content

feat/ Overlay color intensity #1816

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

Closed
wants to merge 1 commit into from

Conversation

AmitShwarts
Copy link
Contributor

Description

  1. support full overlay color.
  2. add opacity when using color different from white.

Changelog

in component Overlay:

  1. Update OverlayIntensityType - add type to support full opacity.
  2. Changed method getStyleByType - refactor.
  3. Add method getOpacity - to compute relevant opacity.

@AmitShwarts AmitShwarts requested a review from ethanshar February 2, 2022 12:45
@ethanshar ethanshar requested review from M-i-k-e-l and removed request for ethanshar February 2, 2022 13:41
Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l left a comment

Choose a reason for hiding this comment

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

Hi @AmitShwarts,
Thanks for the contribution.

The full intensity has an inconsistency:
If you select overlayType={Image.overlayTypes.BOTTOM} and overlayIntensity={Image.overlayIntensityType.HIGH} it will have higher intensity than overlayType={Image.overlayTypes.BOTTOM} and overlayIntensity={Image.overlayIntensityType.FULL}.
Also I am not sure what to actually expect in the second case, perhaps this feature should go through our UX first?

Another thing, in cases where a code is refactored, I like to add tests before the refactor and make sure nothing got broken.

@@ -52,6 +53,23 @@ class Overlay extends PureComponent<OverlayTypes> {
static overlayTypes = OVERLY_TYPES;
static intensityTypes = OverlayIntensityType;

getOpacity(intensity = this.props.intensity, color = this.props.color) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is the default value required here?

@AmitShwarts
Copy link
Contributor Author

we found a different solution for this.
we can send color with opacity as #ff00007f. will be red with opacity 50%.

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.

2 participants