some docs added
This commit is contained in:
parent
1d6a1348ef
commit
a10a0a9958
|
@ -81,7 +81,7 @@ QskGradient::QskGradient( const QColor& color1, const QColor& color2 )
|
|||
QskGradient::QskGradient( QGradient::Preset preset )
|
||||
: QskGradient()
|
||||
{
|
||||
setStops( qskBuildGradientStops( QGradient( preset ).stops() ) );
|
||||
setStops( qskFromQGradientStops( QGradient( preset ).stops() ) );
|
||||
}
|
||||
|
||||
QskGradient::QskGradient( const QVector< QskGradientStop >& stops )
|
||||
|
@ -165,7 +165,7 @@ QskGradient::QskGradient( const QGradient& qGradient )
|
|||
}
|
||||
}
|
||||
|
||||
setStops( qskBuildGradientStops( qGradient.stops() ) );
|
||||
setStops( qskFromQGradientStops( qGradient.stops() ) );
|
||||
}
|
||||
|
||||
QskGradient::QskGradient( const QskGradient& other ) noexcept
|
||||
|
@ -305,7 +305,7 @@ void QskGradient::setStops( const QColor& color1, const QColor& color2 )
|
|||
|
||||
void QskGradient::setStops( QGradient::Preset preset )
|
||||
{
|
||||
const auto stops = qskBuildGradientStops( QGradient( preset ).stops() );
|
||||
const auto stops = qskFromQGradientStops( QGradient( preset ).stops() );
|
||||
setStops( stops );
|
||||
}
|
||||
|
||||
|
|
|
@ -367,7 +367,7 @@ QskGradientStops qskRevertedGradientStops( const QskGradientStops& stops )
|
|||
return s;
|
||||
}
|
||||
|
||||
QVector< QskGradientStop > qskBuildGradientStops( const QGradientStops& qtStops )
|
||||
QVector< QskGradientStop > qskFromQGradientStops( const QGradientStops& qtStops )
|
||||
{
|
||||
QVector< QskGradientStop > stops;
|
||||
stops.reserve( qtStops.count() );
|
||||
|
|
|
@ -129,27 +129,42 @@ QSK_EXPORT QskGradientStops qskInterpolatedGradientStops(
|
|||
const QskGradientStops&, bool, const QskGradientStops&, bool,
|
||||
qreal ratio );
|
||||
|
||||
// interpolating colors in direction of a color.
|
||||
QSK_EXPORT QskGradientStops qskInterpolatedGradientStops(
|
||||
const QskGradientStops&, const QColor&, qreal ratio );
|
||||
|
||||
// interpolating colors starting from a color.
|
||||
QSK_EXPORT QskGradientStops qskInterpolatedGradientStops(
|
||||
const QColor&, const QskGradientStops&, qreal ratio );
|
||||
|
||||
// interpolating the opacity of the colors
|
||||
QSK_EXPORT QskGradientStops qskTransparentGradientStops(
|
||||
const QskGradientStops&, qreal ratio );
|
||||
|
||||
// extracting the colors of [from, to ] and stretching them to [0.0, 1.0]
|
||||
QSK_EXPORT QskGradientStops qskExtractedGradientStops(
|
||||
const QskGradientStops&, qreal from, qreal to );
|
||||
|
||||
// reverting the color stops
|
||||
QSK_EXPORT QskGradientStops qskRevertedGradientStops( const QskGradientStops& );
|
||||
|
||||
/*
|
||||
creating equidistant color stops from a list of colors.
|
||||
when discrete is true the result will contain 2 stops at each position
|
||||
one with the previous and one with the following color so that the
|
||||
interval [pos1-pos2] will be monochrome.
|
||||
*/
|
||||
QSK_EXPORT QskGradientStops qskBuildGradientStops(
|
||||
const QVector< QRgb >&, bool discrete = false );
|
||||
|
||||
QSK_EXPORT QskGradientStops qskBuildGradientStops(
|
||||
const QVector< QColor >&, bool discrete = false );
|
||||
|
||||
QSK_EXPORT QskGradientStops qskRevertedGradientStops( const QskGradientStops& );
|
||||
|
||||
QSK_EXPORT QskGradientStops qskBuildGradientStops( const QVector< QGradientStop >& );
|
||||
/*
|
||||
convert color stops from/to a vector of QGradientStop, that can be
|
||||
used for QGradients.
|
||||
*/
|
||||
QSK_EXPORT QskGradientStops qskFromQGradientStops( const QVector< QGradientStop >& );
|
||||
QSK_EXPORT QVector< QGradientStop > qskToQGradientStops( const QVector< QskGradientStop >& );
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue