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

Add .hexa() method #237

Merged
merged 1 commit into from
Jan 11, 2022
Merged

Add .hexa() method #237

merged 1 commit into from
Jan 11, 2022

Conversation

headwindz
Copy link
Contributor

Currently the hex converter simply ignores the alpha value if the color is of rgba format. The PR resolves the issue.

Related to Do we already have argb hex string converter

@xWayfinder
Copy link

This is a super useful feature @n0rush an svg charting library I use only allows for hex rgba values - @Qix- any chance we could get this PR merged and released?

@xdlrt
Copy link

xdlrt commented Jan 5, 2022

we need this feature too, hope this will be merged soon.

@Qix-
Copy link
Owner

Qix- commented Jan 5, 2022

Hi, as I've said in other issues, this won't be merged as-is. It's a breaking change. Please add a new method, hexa().

@headwindz
Copy link
Contributor Author

Hi, as I've said in other issues, this won't be merged as-is. It's a breaking change. Please add a new method, hexa().

Hi @Qix- , I have made the changes as per your suggestion. Please help review the codes :-)

@xWayfinder
Copy link

Thanks @n0rush I really appreciate the quick turn around and @Qix- thanks for making sure the library is backwards compatible!

@xdlrt
Copy link

xdlrt commented Jan 10, 2022

Is there any new progress now?

@Qix-
Copy link
Owner

Qix- commented Jan 10, 2022

I'll get to this later today, was planning on doing it this morning but the colors fiasco (not color - confusing, I know) had me a bit busy.

Sorry for the delay, PR is fine now and I'll merge this and release as a minor in a few hours.

@xWayfinder
Copy link

Appreciate it @Qix- and completely understand - the colors.js affected a lot of people. It was also a good reminder too not take OSS maintainers for granted. Thanks again for all the work on this library!

@Qix-
Copy link
Owner

Qix- commented Jan 11, 2022

Sorry didn't catch something, alpha should always be returned from hexa(). I'll push a fix now.

@Qix- Qix- merged commit 0ef01ca into Qix-:master Jan 11, 2022
@Qix- Qix- changed the title add rgba to hex support Add .hexa() method Jan 11, 2022
@Qix-
Copy link
Owner

Qix- commented Jan 11, 2022

Thanks :) Published as 4.2.0.

@xWayfinder
Copy link

xWayfinder commented Jan 11, 2022

Hey just wondering if hexa() should work for the following use case?
Color("#fd1231").alpha(0.4).hexa()

@xWayfinder
Copy link

Looks like it was a TypeScript & VSCode issues, all sorted.

@Qix-
Copy link
Owner

Qix- commented Jan 11, 2022

Yeah any typings (including DT) will need to be updated to reflect the new method. I don't maintain them here, sorry about that!

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

Successfully merging this pull request may close these issues.

4 participants