Skip to content
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

Make alpha its own property in the styling language #266

Closed
lilleyse opened this issue Oct 23, 2017 · 7 comments
Closed

Make alpha its own property in the styling language #266

lilleyse opened this issue Oct 23, 2017 · 7 comments

Comments

@lilleyse
Copy link
Contributor

Would it be worthwhile to add an "alpha" property? This would give more flexibility for complex styles where the alpha is treated differently than color.

One example: color by groups but set alpha to be smooth.

{
    "color": {
        "conditions": [
            ["${height} < 100", "color('red')"],
            ["${height} < 200", "color('green')"],
            ["${height} < 300", "color('blue')"],
            ["true", "color('yellow')"]
        ]
    },
    "alpha": "mix(0.0, 1.0, min(${height} / 300, 1.0))"
}
@likangning93
Copy link
Contributor

how Iron Man could we Iron Man?

@pjcozzi pjcozzi added the 1.0 label Oct 27, 2017
@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 27, 2017

I thought about doing this at one point - I might have even done it in the first prototype, but there's no discussion in #2. @ggetz do you recall?

@lilleyse concretely, what do you propose:

color : rgb
alpha : a

or

color : rgba
alpha : a // overrides color.a

or something else?

@ggetz
Copy link
Contributor

ggetz commented Oct 27, 2017

I think there was some brief discussion, but it was put on the back burner since transparency could be accomplished with rgba. I see no reason why not, css has it's own opacity property in addition to rgba.

@lilleyse
Copy link
Contributor Author

I would prefer the override method.

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 27, 2017

Override is OK with me.

Could be scoped 1.0 or post 1.0.

@pjcozzi
Copy link
Contributor

pjcozzi commented Apr 6, 2018

Since this can be done in a backwards compatible way, pushing post 1.0.

@pjcozzi pjcozzi removed the 1.0 label Apr 6, 2018
@lilleyse lilleyse mentioned this issue Nov 15, 2021
85 tasks
@lilleyse
Copy link
Contributor Author

Noted in #2 (comment)

This issue was closed.
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

No branches or pull requests

4 participants