Qix-/color

Bug in alpha handling during model conversions #250

Qix- posted onGitHub

https://github.com/Qix-/color/blob/286fb710033e7a915003c9cdc3a2522a38d9c8a3/index.js#L422

Not sure how this wasn't caught before. I need to verify it's actually a bug, but pretty sure this will always have an alpha of 4.0 (which isn't correct anyway) if the model conversion is given an alpha value. Need to add a failing test.


It was a bug, but was hidden by the fact that there's never a case where args.length == 0 (otherwise the case above it would fire) and args[channels] !== undefined, since args is computed by the language and not by the users. I thought pretty long and hard about how I'd hack this and I don't think you could, so it's safe to remove the ternary here.

posted by Qix- about 3 years ago

Fund this Issue

$0.00
Funded

Pull requests