CanvasGradient QML Type
Provides an opaque CanvasGradient interface 更多...
Import Statement: | import QtQuick 2.7 |
开始支持版本: | Qt 5.0 |
方法
- CanvasGradient addColorStop(real offsetof, string color)
详细描述
成员
CanvasGradient addColorStop(real offsetof, string color) |
Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.
For example:
var gradient = ctx.createLinearGradient(0, 0, 100, 100); gradient.addColorStop(0.3, Qt.rgba(1, 0, 0, 1)); gradient.addColorStop(0.7, 'rgba(0, 255, 255, 1');