Closed cormullion closed 4 years ago
cf. #250
Yes, I kind of see. Although the alpha values are 1 here.
It is possible to provide special treatments for transparent colors when the alpha values are 1, but I don't see the need to do that. If the users know that the alpha values are always 1, they can use color()
.
I think what we need to do is to improve the error message.
I suppose you could do something like:
function colordiff(ai::RGBA, bi::RGBA;
metric::DifferenceMetric=DE_2000())
if ai.alpha != 1 || bi.alpha != 1
@warn "Ignoring alpha value of transparent colors..."
end
_colordiff(convert(RGB, ai), convert(RGB, bi), metric)
end
just to help people keep working. The warnings could prompt them to change their code... :)
This could print thousands of warnings if it's an image...
Just wondering why
colordiff
doesn't work with all colors?There's probably a good reason, but I'm interested to know what it is.
Colors v0.12.3, Julia 1.5.0