qml: fee histogram colours: extend colour palette to cover sub-1 s/b
What changed, and why it matters
This commit is a purely cosmetic change to the mobile/QML version of Electrum. It adjusts the color-coding of a mempool fee histogram so that very low fee rates (below 1 satoshi per virtual byte) are shown as darker shades rather than all looking the same. There is no security relevance.
No security action needed. Treat as normal UI polish.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change refactors an inline color calculation in NetworkOverview.qml into a helper function _getFeerateColor. Previously the hue was computed with Math.max(modelData[0], 1), clamping sub-1 sat/vbyte values to 1. The new function preserves the existing hue mapping for [1, 600] sat/vbyte and adds a separate value/brightness dimming for the [0, 1] sat/vbyte range. This is a UI-only enhancement with no logic, cryptographic, network, or wallet changes.
Changed components
electrum/gui/qml/components/NetworkOverview.qmlInspect captured patch +17 / −1
diff --git a/electrum/gui/qml/components/NetworkOverview.qml b/electrum/gui/qml/components/NetworkOverview.qml
index 7e9b21f..12ffdc6 100644
--- a/electrum/gui/qml/components/NetworkOverview.qml
+++ b/electrum/gui/qml/components/NetworkOverview.qml
@@ -13,6 +13,22 @@ Pane {
property string title: qsTr("Network")
+ function _getFeerateColor(sat_per_vbyte) {
+ // To display a nice quickly graspable view of the mempool fee histogram, we map
+ // feerates to fixed colors. E.g. when the histogram is full of red, the user can
+ // instantly see fees are high.
+ // In the 1-600 s/b range, play with hue:
+ var hsv_hue = (2/3-(2/3*(
+ Math.log(
+ Math.min(600, Math.max(sat_per_vbyte, 1))
+ )
+ /Math.log(600))
+ ))
+ // In the 0-1 s/b range, play with value:
+ var hsv_value = Math.min(sat_per_vbyte, 1)
+ return Qt.hsva(hsv_hue, 0.8, hsv_value, 1)
+ }
+
ColumnLayout {
anchors.fill: parent
spacing: 0
@@ -118,7 +134,7 @@ Pane {
Layout.preferredWidth: 300 * (modelData[1] / Network.feeHistogram.total)
Layout.fillWidth: true
height: parent.height
- color: Qt.hsva(2/3-(2/3*(Math.log(Math.min(600, Math.max(modelData[0], 1)))/Math.log(600))), 0.8, 1, 1)
+ color: _getFeerateColor(modelData[0])
ToolTip.text: (qsTr("%1 around depth %2")
.arg(modelData[0] + " " + UI_UNIT_NAME.FEERATE_SAT_PER_VB)
.arg((modelData[2]/1000000).toFixed(2) + " " + UI_UNIT_NAME.MEMPOOL_MB)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.