-
Notifications
You must be signed in to change notification settings - Fork 291
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
Optional alpha
parameter for draw
groups
#740
Conversation
It's possible the |
cc @matteblair @meetar @sensescape @burritojustice @nvkelso @tallytalwar for comment. |
@bcamper Looks great from here! Couple of questions about the PR description:
This is because nothing will draw, correct? So this line is clarifying that there won't be some kind of default color applied in order to apply an alpha to it.
Are there cases where the "original unmodifed value" could be something other than 1.0? |
Yep, that's right, feel free to help clarify the language if you have suggestions.
For sure! Any time
I should have put in an example where it is very explicitly overriding, even at one level, like:
Basically, whenever |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I don't see any problems implementing this in Tangram ES too.
Again, 👏 on the great description @bcamper. Sorry couldn't jump on this before. But looks good to me too. |
This PR adds a new
alpha
parameter inside severaldraw
group contexts. It allows the scene author to set only the alpha channel of a color, independently of the RGB channels.Use cases where this is helpful include:
Syntax
draw
groups, where thealpha
parameter, if present, will override the alpha channel set by the corresponding color parameter:polygons
:color
lines
:color
outline
block):color
points
:color
outline
block):color
text
blocktext
font
block):fill
font.stroke
block):color
alpha
values can be set by:alpha: 0.5
alpha: [[14, 0.5], [16, 1]]
(fade in opacity from z14-16)alpha: function(){ return feature.height/200; }
(set building opacity by height)alpha
parameter has no effect if no color is specified. In cases where a default color applies, thealpha
parameter will modify the default color if no color is specified.alpha
parameter inherits through sub-layers like any otherdraw
parameter, and does not need to be defined at the same depth as acolor
it modifies; it will modify the nearest ancestor layer where color is defined.alpha: null
, it un-sets any value set by an ancestor layer. The color's alpha channel returns to its original, unmodified value.polygons
andlines
, alpha channel is only applicable for appropriateblend
modes (translucent
,overlay
, etc.), and is not intended to be used with the defaultopaque
blending.