843 qreal animationFrame = 0;
852 qreal percentOfAnimation = animationFrame;
853 if (percentOfAnimation > 1) {
854 percentOfAnimation -= ((int)percentOfAnimation);
859 int startElem =
qFloor(currentPosition);
860 int endElem =
qCeil(currentPosition);
864 qreal percentOfColorMorph = currentPosition;
865 if (percentOfColorMorph > 1) {
866 percentOfColorMorph -= ((int)percentOfColorMorph);
871 qreal rDiff = (end.
red() - start.
red()) * percentOfColorMorph;
873 qreal bDiff = (end.
blue() - start.
blue()) * percentOfColorMorph;
875 int alpha = int(start.
alpha() + aDiff);
876 int red = int(start.
red() + rDiff);
878 int blue = int(start.
blue() + bDiff);
880 QColor color(red, green, blue, alpha);
The QColor class provides colors based on RGB, HSV or CMYK values.
int count(const T &t) const
Returns the number of occurrences of value in the list.
ushort red
Returns the red color component of this color.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
void setColor(const QColor &color)
Sets the color of this pen's brush to the given color.
const QPen & pen() const
Returns the painter's current pen.
int currentElapsed() const
const QBrush & brush() const
Returns the painter's current brush.
void setColor(const QColor &color)
Sets the brush color to the given color.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
ushort blue
Returns the blue color component of this color.
ushort alpha
Returns the alpha color component of this color.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
QSvgTinyDocument * document() const
static const KeyPair *const end
ushort green
Returns the green color component of this color.