Wrong hex color values
mcavazotti opened this issue · comments
Matheus commented
Steps to Reproduce
- Create a
Color
object instance (for example green#00ff00
) - Apply any of the following methods:
saturate
,desaturate
,darken
,lighten
- Call
toHex
const color = Color.Green;
console.log('Original color:\t',color.toHex());
console.log('saturate:\t', color.clone().saturate().toHex());
console.log('desaturate:\t', color.clone().desaturate().toHex());
console.log('darken:\t\t', color.clone().darken().toHex());
console.log('lighten:\t', color.clone().lighten().toHex());
Expected Result
It should print a valid hexadecimal representation of a color;
Actual Result
Original color: #00ff00
saturate: #-c.c0000000000310b.c-c.c00000000003
desaturate: #c.c00000000003f2.4c.c00000000003
darken: #00e5.800
lighten: #19.800000000006ff19.800000000006
Environment
- browsers and versions: Chrome
- operating system: Windows
- Excalibur versions: 0.29.1
Current Workaround
Monkey patching?
Matheus commented
I can create a PR to fix it
Erik Onarheim commented
@mcavazotti Good find! This is definitely a bug, please do proceed with a PR!