29#ifndef QA_COMMON_COLOR4D_TEST_UTILS__H
30#define QA_COMMON_COLOR4D_TEST_UTILS__H
43 return KI_TEST::IsWithin<double>( aCol.
r, aOther.
r, aTol )
44 && KI_TEST::IsWithin<double>( aCol.
g, aOther.
g, aTol )
45 && KI_TEST::IsWithin<double>( aCol.
b, aOther.
b, aTol )
46 && KI_TEST::IsWithin<double>( aCol.
a, aOther.
a, aTol );
53 unsigned char b,
unsigned char a )
55 const double tol = 0.5 / 255.0;
57 return KI_TEST::IsWithin<double>( aCol.
r, r / 255.0, tol )
58 && KI_TEST::IsWithin<double>( aCol.
g, g / 255.0, tol )
59 && KI_TEST::IsWithin<double>( aCol.
b, b / 255.0, tol )
60 && KI_TEST::IsWithin<double>( aCol.
a, a / 255.0, tol );
A color representation with 4 components: red, green, blue, alpha.
bool IsColorNearHex(const KIGFX::COLOR4D &aCol, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Checks if a COLOR4D is close enough to a given RGB char value.
bool IsColorNear(const KIGFX::COLOR4D &aCol, const KIGFX::COLOR4D aOther, double aTol)
Checks if a COLOR4D is close enough to another.
Numerical test predicates.