Qix-/color

alpha value missing in hex() output #191

raleik-pl posted onGitHub

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)


Please, search issues before opening a new one.

Duplicate of #125.

posted by Qix- over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests