this fixes tests that ended up comparing zero alpha to an unitialized alpha value
also improve reporting so that failing color comparison tests will print the color in hex
Co-authored-by: bi4k8 <bi4k8@github>
* gradients: fix saturation calculation for 32-bit systems
this multiplication has two 512 scale factors as well as 360 and a color difference of up to 255. as such, it can overflow 32 bits, which results in an incorrect saturation value being computed
cast to uint64_t so we have enough bits to multiply without overflow
* gradients: fix luma calculation for 32-bit systems
this multiplication has 0-255 colors at 512 scale factor being multiplied by 10000 (summed across components), then multiplied by 360
this multiplication (360 * 10000 * 255 * 512) overflows a long on 32-bit systems, computing the wrong luma value
cast to uint64_t so we have enough bits to multiply without overflow
---------
Co-authored-by: bi4k8 <bi4k8@github>
* gradient, colours: use 24-bit colour depth internally on Wayland
our Colour type assumes this anyway; lower colour depth should be handled by display backends
* core: restore gradient color computation
this was mistakenly disabled when moving to a unified Colour representation
* core, gradient: use Colour type
* tests: gradient: always test hsv/hcl
colour computations no longer depend on the display backends we compile with, so these can be tested unconditionally now
* gradients, specials: use Color type
this makes specials now accept color names as well as hex codes, and removes all notions of color depth from gradient calculations
---------
Co-authored-by: bi4k8 <bi4k8@github>