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

alpha value missing in hex() output #191

Closed
raleik-pl opened this issue Dec 28, 2020 · 1 comment
Closed

alpha value missing in hex() output #191

raleik-pl opened this issue Dec 28, 2020 · 1 comment

Comments

@raleik-pl
Copy link

raleik-pl commented Dec 28, 2020

There is no alpha value in hex() output, even thought it was parsed and is present in Color object:

let c = Color('rgba(1, 2, 3, 0.4)')
console.log(c)
> Color {model: "rgb", color: Array(3), valpha: 0.4}
  color: (3) [1, 2, 3]
  model: "rgb"
  valpha: 0.4

console.log(c.object())
> {r: 1, g: 2, b: 3, alpha: 0.4}

console.log(c.hex())
> #010203

The correct output should be #01020366 (alpha 0.4 is decimal 102 is hex 66)

@Qix-
Copy link
Owner

Qix- commented Dec 28, 2020

Please, search issues before opening a new one.

Duplicate of #125.

@Qix- Qix- closed this as completed Dec 28, 2020
Repository owner locked as resolved and limited conversation to collaborators Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants