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

Do we already have argb hex string converter? #72

Closed
kof opened this issue Oct 26, 2015 · 18 comments
Closed

Do we already have argb hex string converter? #72

kof opened this issue Oct 26, 2015 · 18 comments

Comments

@kof
Copy link

kof commented Oct 26, 2015

Like this one http://lesscss.org/functions/#color-definition-argb

@MoOx
Copy link
Collaborator

MoOx commented Oct 27, 2015

Nope, but if something needs to be implemented, it will be probably #rrggbbaa.
Should be done easily by adding hexAlphaString in color-string package.

@kof
Copy link
Author

kof commented Oct 27, 2015

Nope, its AARRGGBB

@kof
Copy link
Author

kof commented Oct 27, 2015

https://msdn.microsoft.com/en-us/library/ms532930(v=vs.85).aspx

Color is expressed in #AARRGGBB format, where AA is the alpha hexadecimal value, RR is the red hexadecimal value, GG is the green hexadecimal value, and BB is the blue hexadecimal value. The alpha value controls the opacity of the object. An alpha value of 00 is transparent, while a value of FF is opaque.

@Qix-
Copy link
Owner

Qix- commented Oct 27, 2015

ARGB or RGBA are two different representations - both are valid, but some are used in different places. RGBA makes more sense from an API standpoint since common overloading practices append "optional" parameters to the end.

@kof
Copy link
Author

kof commented Oct 27, 2015

yep, however what I was asking for was specifically a string for IE compatible argb thing.

@Qix-
Copy link
Owner

Qix- commented Oct 27, 2015

Unless I'm mistaken, you should be able to pass ARGB values to RGBA and get the intended result.

@kof
Copy link
Author

kof commented Oct 27, 2015

Well I need to covert to ARGB, not from.

@kof
Copy link
Author

kof commented Oct 27, 2015

I didn't find any reference whether IE filter supports rgba or anything else.

@MoOx
Copy link
Collaborator

MoOx commented Oct 27, 2015

w3c css color spec only mention #rrggbbaa (or #rgba) https://drafts.csswg.org/css-color/#hex-notation

Anyway, PR are always welcome. I think we can bring that with alphaHexString (#argb) and hexAlphaString (#rgba).

@kof
Copy link
Author

kof commented Oct 27, 2015

I think its IE only non standard thing.

@Qix-
Copy link
Owner

Qix- commented Jan 23, 2016

(sigh) Of course it's an IE thing. I'll add this in the new version.

@Qix- Qix- removed the pr welcome label Jan 23, 2016
@Qix- Qix- added this to the 1.0.0 (Makeover) milestone Jan 23, 2016
@kof
Copy link
Author

kof commented Jan 23, 2016

👍

@MoOx
Copy link
Collaborator

MoOx commented Jan 24, 2016

@Qix- It's in recent CSS specs too.

@Qix-
Copy link
Owner

Qix- commented Nov 16, 2016

This is actually a color-string addition :) I'll create a ticket for you.

Thanks for bringing it up! I'm not sure if it'll make it into the 1.x makeover at this point, but I'll definitely address it.

@hoangsonbk
Copy link

Hi, just to check if we have this feature already?

@Qix-
Copy link
Owner

Qix- commented May 9, 2019

Nope, feel free to help out and open a PR :)

@headwindz
Copy link
Contributor

I have opened a PR for this. Please help review :- @Qix-

@Qix-
Copy link
Owner

Qix- commented Jan 11, 2022

Released .hexa() as 4.2.0. Thanks @n0rush :)

@Qix- Qix- closed this as completed Jan 11, 2022
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

5 participants