颜色映射图例,规格尺寸修改
This commit is contained in:
@@ -7,9 +7,14 @@ Item {
|
||||
id: root
|
||||
property int minValue: 0
|
||||
property int maxValue: 100
|
||||
property color colorLow: Qt.rgba(0.10, 0.75, 1.00, 1.0)
|
||||
property color colorMid: Qt.rgba(0.10, 0.95, 0.35, 1.0)
|
||||
property color colorHigh: Qt.rgba(1.00, 0.22, 0.10, 1.0)
|
||||
property int barWidth: 34
|
||||
property int barRadius: 8
|
||||
|
||||
implicitWidth: 90
|
||||
implicitHeight: 220
|
||||
implicitWidth: barWidth + 48
|
||||
implicitHeight: 240
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
@@ -25,17 +30,16 @@ Item {
|
||||
Rectangle {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillHeight: true
|
||||
width: 26
|
||||
radius: 6
|
||||
width: root.barWidth
|
||||
radius: root.barRadius
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(1, 1, 1, 0.18)
|
||||
|
||||
gradient: Gradient {
|
||||
// must match shaders/dots.frag:dataColorRamp (high at top)
|
||||
GradientStop { position: 0.00; color: Qt.rgba(1.00, 0.22, 0.10, 1.0) } // c3
|
||||
GradientStop { position: 0.34; color: Qt.rgba(1.00, 0.92, 0.22, 1.0) } // c2
|
||||
GradientStop { position: 0.67; color: Qt.rgba(0.10, 0.95, 0.35, 1.0) } // c1
|
||||
GradientStop { position: 1.00; color: Qt.rgba(0.10, 0.75, 1.00, 1.0) } // c0
|
||||
GradientStop { position: 0.00; color: root.colorHigh }
|
||||
GradientStop { position: 0.50; color: root.colorMid }
|
||||
GradientStop { position: 1.00; color: root.colorLow }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,4 +51,3 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user