[PATCH 7 of 8 DarkThemeSeries 2] graph: add dark-theme color palette for revision graph

0 views
Skip to first unread message

Peter Demcak

unread,
Mar 6, 2026, 2:41:41 PM (4 days ago) Mar 6
to thg...@googlegroups.com
# HG changeset patch
# User Peter Demcak <majs...@gmail.com>
# Date 1772737258 -3600
# Thu Mar 05 20:00:58 2026 +0100
# Node ID 6162e5e90a503ff93d5e5bddc798324a2634c124
# Parent fe0d0fb5e8462d558b7a229c8ba44f92353afb0e
graph: add dark-theme color palette for revision graph

diff -r fe0d0fb5e846 -r 6162e5e90a50 tortoisehg/hgqt/graph.py
--- a/tortoisehg/hgqt/graph.py Thu Mar 05 20:00:37 2026 +0100
+++ b/tortoisehg/hgqt/graph.py Thu Mar 05 20:00:58 2026 +0100
@@ -48,6 +48,8 @@
obsoleteutil,
)

+from .theme import THEME
+
r"""
How each edge color is determined
=================================
@@ -254,20 +256,34 @@
NODE_SHAPE_REVISION_DRAFT = 4
NODE_SHAPE_REVISION_SECRET = 5

-# TODO: Remove these two when we adopt GTK author color scheme
-COLORS = [
- '#0000ff', # blue
- '#006400', # dark green
- '#008000', # green
- '#00008b', # dark blue
- '#800080', # purple
- '#1e90ff', # dodger blue
- '#808000', # dark yellow
- '#ff00ff', # magenta
- '#8b008b', # dark magenta
- '#008b8b', # dark cyan
-]
-
+if THEME.enabled:
+ # Dark-theme branch / graph colors
+ COLORS = [
+ '#3a5dc4', # dark blue
+ '#14532d', # dark green
+ '#166534', # green (darkened)
+ '#1e3a8a', # dark blue
+ '#4c1d95', # purple
+ '#1e40af', # dodger blue (dark)
+ '#5f5a1a', # dark yellow / olive
+ '#86198f', # magenta (dark)
+ '#5b1366', # dark magenta
+ '#155e75', # dark cyan
+ ]
+else:
+ # TODO: Remove these two when we adopt GTK author color scheme
+ COLORS = [
+ '#0000ff', # blue
+ '#006400', # dark green
+ '#008000', # green
+ '#00008b', # dark blue
+ '#800080', # purple
+ '#1e90ff', # dodger blue
+ '#808000', # dark yellow
+ '#ff00ff', # magenta
+ '#8b008b', # dark magenta
+ '#008b8b', # dark cyan
+ ]

def hashcolor(data, modulo=None):
"""function to reliably map a string to a color index

Reply all
Reply to author
Forward
0 new messages