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

CSS Color Module 4 - 8-digit color codes. #428

Open
cburschka opened this issue Sep 22, 2016 · 3 comments
Open

CSS Color Module 4 - 8-digit color codes. #428

cburschka opened this issue Sep 22, 2016 · 3 comments
Assignees
Milestone

Comments

@cburschka
Copy link
Owner

https://drafts.csswg.org/css-color/
https://www.w3.org/TR/css-color-4/

This standardizes #RRGGBBAA and #RGBA codes where the A is a hexadecimal representation of opacity (0-255).

Cadence currently adds opacity to a dynamic color value in the text color button, whose background is set to 50% opacity of whatever the chosen color is. To accomplish this, cadence parses the hex value and outputs an rgba(x,y,z,0.5) string.

As soon as this standard can be relied on, this function can be replaced by a simple string concatenation.

@cburschka cburschka added this to the 3.0 milestone Sep 22, 2016
@cburschka cburschka self-assigned this Sep 22, 2016
@sylae
Copy link
Contributor

sylae commented Sep 22, 2016

so what you're saying is i can set my text colour to have 0% opacity now?

+1

On 22 Sep 2016 5:16 p.m., "Christoph Burschka" notifications@github.com
wrote:

https://drafts.csswg.org/css-color/
https://www.w3.org/TR/css-color-4/

This standardizes #RRGGBBAA and #RGBA codes where the A is a hexadecimal
representation of opacity (0-255).

Cadence currently adds opacity to a dynamic color value in the text color
button, whose background is set to 50% opacity of whatever the chosen color
is. To accomplish this, cadence parses the hex value and outputs an
rgba(x,y,z,0.5) string.

As soon as this standard can be relied on, this function can be replaced
by a simple string concatenation.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#428, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACqYzNc_mBCybantf9XQO1NAMzo4G7Hmks5qsvBAgaJpZM4KEXxc
.

@cburschka
Copy link
Owner Author

cburschka commented Sep 22, 2016

This is just for the button. But yeah, technically config.settings.textColor = '#......XX' lets you do crazy stuff like this: :P

screenshot from 2016-09-22 23-51-31

@cburschka
Copy link
Owner Author

cburschka commented Sep 27, 2016

Note: While Firefox supports this, jQuery doesn't.

element.style.color = '...' works.
$(element).css('color', '...') doesn't work; the opacity value is lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants