colourPair

Undocumented in source. Be warned that the author may not have intended to support it.
colourPair
(
FG
BG
)

Examples

import std.math : approxEqual;
with(colourPair(RGB888(0, 0, 0), RGB888(255, 255, 255))) {
	assert(contrast.approxEqual(21.0));
	assert(meetsWCAGAACriteria);
	assert(meetsWCAGAAACriteria);
}
with(colourPair(RGB888(255, 255, 255), RGB888(255, 255, 255))) {
	assert(contrast.approxEqual(1.0));
	assert(!meetsWCAGAACriteria);
	assert(!meetsWCAGAAACriteria);
}
with(colourPair(RGB888(0, 128, 255), RGB888(0, 0, 0))) {
	assert(contrast.approxEqual(5.5316));
	assert(meetsWCAGAACriteria);
	assert(!meetsWCAGAAACriteria);
}
with(colourPair(BGR555(0, 16, 31), RGB888(0, 0, 0))) {
	assert(contrast.approxEqual(5.7236));
	assert(meetsWCAGAACriteria);
	assert(!meetsWCAGAAACriteria);
}

Meta