How to attach alpha value to hex string output? #446
-
I'm trying to get my color as a hex string with the alpha value. Currently I'm trying to use this myColor.toString({format: {name: 'hex', noAlpha: false}}) |
Beta Was this translation helpful? Give feedback.
Answered by
MysteryBlokHed
Feb 19, 2024
Replies: 1 comment
-
The alpha value is automatically included when it is not 1: const color = new Color("red");
color.toString({ format: "hex" }); // "#f00"
color.alpha = 0.5;
color.toString({ format: "hex" }); // "#ff000080" |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
MysteryBlokHed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The alpha value is automatically included when it is not 1: