50 #include "HuePartitioningColors.hh"
56 #define DEFAULT_SATURATION 1.0f
57 #define DEFAULT_VALUE 1.0f
60 currentSubdiv_(2), currentIt_(0), currentTriadIt_(0),
61 alpha_(_alpha), baseHue_(_baseHue),
62 defaultSaturation_(DEFAULT_SATURATION), defaultValue_(DEFAULT_VALUE) {
65 static inline float wrap01(
float v) {
67 if (v > 1.0f) v = modff(v, &dummy);
68 if (v < 0.0f) v = 1.0f - modff(v, &dummy);
73 const float resultHue =
75 + .33333333f / currentSubdiv_ * currentIt_
76 + .33333333f * currentTriadIt_;
80 QColor::fromHsvF(wrap01(resultHue), defaultSaturation_,
81 defaultValue_, alpha_).getRgbF(
83 const Vec4f result(r, g, b, alpha_);
90 if (++currentTriadIt_ <= 2)
97 currentIt_ += (currentSubdiv_ == 2 ? 1 : 2);
98 if (currentIt_ < currentSubdiv_)
Namespace providing different geometric functions concerning angles.
virtual Vec4f generateNextColor()
HuePartitioningColors(float _alpha=1.0f, float _baseHue=0.5694f)