35 std::numeric_limits<unsigned char>::max();
40 (2.0*M_PI)*std::numeric_limits<unsigned char>::max()));
46 rgb.setAlphaF(hsv.alphaF());
48 if (hsv.blueF() > 0.0) {
49 float hue = hsv.redF()*2.0*M_PI/(60.0*M_PI/180.0);
52 float p = hsv.blueF()*(1.0-hsv.greenF());
53 float q = hsv.blueF()*(1.0-hsv.greenF()*f);
54 float t = hsv.blueF()*(1.0-hsv.greenF()*(1.0-f));
58 rgb.setRedF(hsv.blueF());
64 rgb.setGreenF(hsv.blueF());
69 rgb.setGreenF(hsv.blueF());
75 rgb.setBlueF(hsv.blueF());
80 rgb.setBlueF(hsv.blueF());
83 rgb.setRedF(hsv.blueF());
90 rgb.setRedF(hsv.blueF());
91 rgb.setGreenF(hsv.blueF());
92 rgb.setBlueF(hsv.blueF());
100 hsv.setRgbF(
intToHue(val), 1.0, 1.0, 1.0);
106 return QColor::fromRgbF(1.0-rgb.redF(), 1.0-rgb.greenF(), 1.0-rgb.blueF(),
static QColor invertRgb(const QColor &rgb)
static QColor hsvToRgb(const QColor &hsv)
static QColor intToRgb(unsigned char val)
static float intToHue(unsigned char val)
static unsigned char revertByte(unsigned char val)
static unsigned char hueToInt(float hue)