#include <KoSegmentGradient.h>
Definition at line 149 of file KoSegmentGradient.h.
◆ HSVCWColorInterpolationStrategy()
| KoGradientSegment::HSVCWColorInterpolationStrategy::HSVCWColorInterpolationStrategy |
( |
| ) |
|
|
private |
Definition at line 647 of file KoSegmentGradient.cpp.
649{
650}
const KoColorSpace *const m_colorSpace
static KoColorSpaceRegistry * instance()
◆ colorAt()
| void KoGradientSegment::HSVCWColorInterpolationStrategy::colorAt |
( |
KoColor & | dst, |
|
|
qreal | t, |
|
|
const KoColor & | start, |
|
|
const KoColor & | end ) const |
|
overridevirtual |
Implements KoGradientSegment::ColorInterpolationStrategy.
Definition at line 662 of file KoSegmentGradient.cpp.
663{
664 QColor sc;
665 QColor ec;
666
668 end.toQColor(&ec);
669
670 int s = static_cast<int>(sc.saturation() + t * (ec.saturation() - sc.saturation()) + 0.5);
671 int v =
static_cast<int>(sc.value() + t * (ec.value() - sc.value()) + 0.5);
673
674 if (ec.hue() < sc.hue()) {
675 h =
static_cast<int>(ec.hue() + (1 - t) * (sc.hue() - ec.hue()) + 0.5);
676 } else {
677 h =
static_cast<int>(ec.hue() + (1 - t) * (360 - ec.hue() + sc.hue()) + 0.5);
678
679 if (h > 359) {
681 }
682 }
683
684 qreal opacity{sc.alphaF() + t * (ec.alphaF() - sc.alphaF())};
685
686 QColor result;
687 result.setHsv(h, s,
v);
688 result.setAlphaF(opacity);
690}
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 652 of file KoSegmentGradient.cpp.
653{
657 }
658
660}
static HSVCWColorInterpolationStrategy * m_instance
HSVCWColorInterpolationStrategy()
◆ type()
| int KoGradientSegment::HSVCWColorInterpolationStrategy::type |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ m_colorSpace
| const KoColorSpace* const KoGradientSegment::HSVCWColorInterpolationStrategy::m_colorSpace |
|
private |
◆ m_instance
The documentation for this class was generated from the following files: