import std.math : isClose; with(RGB888(255, 0, 0).toHSVA) { assert(hue.isClose(0.0)); assert(saturation.isClose(1.0)); assert(value.isClose(1.0)); assert(alpha.isClose(1.0)); } with(RGBA8888(255, 0, 0, 255).toHSVA) { assert(hue.isClose(0.0)); assert(saturation.isClose(1.0)); assert(value.isClose(1.0)); assert(alpha.isClose(1.0)); } with(RGBA8888(255, 0, 0, 0).toHSVA) { assert(hue.isClose(0.0)); assert(saturation.isClose(1.0)); assert(value.isClose(1.0)); assert(alpha.isClose(0.0)); }