43 #include "HuePartitioningColors.hh" 49 #define DEFAULT_SATURATION 1.0f 50 #define DEFAULT_VALUE 1.0f 53 currentSubdiv_(2), currentIt_(0), currentTriadIt_(0),
54 alpha_(_alpha), baseHue_(_baseHue),
55 defaultSaturation_(DEFAULT_SATURATION), defaultValue_(DEFAULT_VALUE) {
58 static inline float wrap01(
float v) {
60 if (v > 1.0f) v = modff(v, &dummy);
61 if (v < 0.0f) v = 1.0f - modff(v, &dummy);
66 const float resultHue =
68 + .33333333f / currentSubdiv_ * currentIt_
69 + .33333333f * currentTriadIt_;
73 QColor::fromHsvF(wrap01(resultHue), defaultSaturation_,
74 defaultValue_, alpha_).getRgbF(
76 const Vec4f result(r, g, b, alpha_);
83 if (++currentTriadIt_ <= 2)
90 currentIt_ += (currentSubdiv_ == 2 ? 1 : 2);
91 if (currentIt_ < currentSubdiv_)
Namespace providing different geometric functions concerning angles.
virtual Vec4f generateNextColor()
HuePartitioningColors(float _alpha=1.0f, float _baseHue=0.5694f)