#include <KoSegmentGradient.h>
Definition at line 165 of file KoSegmentGradient.h.
◆ HSVCCWColorInterpolationStrategy()
| KoGradientSegment::HSVCCWColorInterpolationStrategy::HSVCCWColorInterpolationStrategy |
( |
| ) |
|
|
private |
Definition at line 692 of file KoSegmentGradient.cpp.
694{
695}
const KoColorSpace *const m_colorSpace
static KoColorSpaceRegistry * instance()
◆ colorAt()
| void KoGradientSegment::HSVCCWColorInterpolationStrategy::colorAt |
( |
KoColor & | dst, |
|
|
qreal | t, |
|
|
const KoColor & | start, |
|
|
const KoColor & | end ) const |
|
overridevirtual |
Implements KoGradientSegment::ColorInterpolationStrategy.
Definition at line 708 of file KoSegmentGradient.cpp.
709{
710 QColor sc;
711 QColor se;
712
714 end.toQColor(&se);
715
716 int s = static_cast<int>(sc.saturation() + t * (se.saturation() - sc.saturation()) + 0.5);
717 int v =
static_cast<int>(sc.value() + t * (se.value() - sc.value()) + 0.5);
719
720 if (sc.hue() < se.hue()) {
721 h =
static_cast<int>(sc.hue() + t * (se.hue() - sc.hue()) + 0.5);
722 } else {
723 h =
static_cast<int>(sc.hue() + t * (360 - sc.hue() + se.hue()) + 0.5);
724
725 if (h > 359) {
727 }
728 }
729
730 qreal opacity = sc.alphaF() + t * (se.alphaF() - sc.alphaF());
731
732 QColor result;
733 result.setHsv(h, s,
v);
734 result.setAlphaF(opacity);
736}
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.
void toQColor(QColor *c) const
a convenience method for the above.
References KoColor::fromQColor(), KoColor::toQColor(), and v.
◆ instance()
Definition at line 698 of file KoSegmentGradient.cpp.
699{
703 }
704
706}
static HSVCCWColorInterpolationStrategy * m_instance
HSVCCWColorInterpolationStrategy()
◆ type()
| int KoGradientSegment::HSVCCWColorInterpolationStrategy::type |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ m_colorSpace
| const KoColorSpace* const KoGradientSegment::HSVCCWColorInterpolationStrategy::m_colorSpace |
|
private |
◆ m_instance
The documentation for this class was generated from the following files: