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 |
matteblair
left a comment
There was a problem hiding this comment.
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
alphaparameter inside severaldrawgroup 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
drawgroups, where thealphaparameter, if present, will override the alpha channel set by the corresponding color parameter:polygons:colorlines:coloroutlineblock):colorpoints:coloroutlineblock):colortextblocktextfontblock):fillfont.strokeblock):coloralphavalues can be set by:alpha: 0.5alpha: [[14, 0.5], [16, 1]](fade in opacity from z14-16)alpha: function(){ return feature.height/200; }(set building opacity by height)alphaparameter has no effect if no color is specified. In cases where a default color applies, thealphaparameter will modify the default color if no color is specified.alphaparameter inherits through sub-layers like any otherdrawparameter, and does not need to be defined at the same depth as acolorit 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.polygonsandlines, alpha channel is only applicable for appropriateblendmodes (translucent,overlay, etc.), and is not intended to be used with the defaultopaqueblending.