]> git.ipfire.org Git - collecty.git/blame - src/collecty/colours.py
Introduce a colour scheme and fix design of the graphs
[collecty.git] / src / collecty / colours.py
CommitLineData
9823dfef
MT
1#!/usr/bin/python3
2###############################################################################
3# #
4# collecty - A system statistics collection daemon for IPFire #
5# Copyright (C) 2015 IPFire development team #
6# #
7# This program is free software: you can redistribute it and/or modify #
8# it under the terms of the GNU General Public License as published by #
9# the Free Software Foundation, either version 3 of the License, or #
10# (at your option) any later version. #
11# #
12# This program is distributed in the hope that it will be useful, #
13# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15# GNU General Public License for more details. #
16# #
17# You should have received a copy of the GNU General Public License #
18# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19# #
20###############################################################################
21
03ba5630
MT
22from . import util
23
29455c5f
MT
24BLACK = "#000000"
25WHITE = "#FFFFFF"
03ba5630
MT
26GREY = "#9E9E9E"
27LIGHT_GREY = "#F5F5F5"
29455c5f 28
03ba5630
MT
29RED = "#F44336"
30LIGHT_RED = "#CC0033"
31YELLOW = "#FFEB3B"
29455c5f 32LIGHT_YELLOW = "#FFFF66"
03ba5630
MT
33GREEN = "#4CAF50"
34LIGHT_GREEN = "#8BC34A"
35BLUE = "#2196F3"
36LIGHT_BLUE = "#03A9F4"
29455c5f 37
03ba5630
MT
38AMBER = "#FFC107"
39BROWN = "#795548"
40CYAN = "#00BCD4"
41INDIGO = "#3F51B5"
42LIME = "#CDDC39"
43ORANGE = "#FF9800"
44DEEP_ORANGE = "#FF5722"
45PINK = "#E91E63"
46PURPLE = "#9C27B0"
47DEEP_PURPLE = "#673AB7"
48TEAL = "#009688"
49
50COLOUR_OK = LIGHT_GREEN
51COLOUR_CRITICAL = LIGHT_RED
52COLOUR_ERROR = COLOUR_CRITICAL
53COLOUR_WARN = LIGHT_YELLOW
54COLOUR_TEXT = util.lighten(BLACK, 0.87) # 87% grey
55
56PRIMARY = INDIGO
57ACCENT = PINK
58
59# Lighten the areas by this factor
60AREA_OPACITY = 0.25
61STDDEV_OPACITY = 0.33
62
63# Receive and transmit
64COLOUR_RX = RED
65COLOUR_TX = GREEN
66
67# I/O
68COLOUR_READ = GREEN
69COLOUR_WRITE = RED
70
71# IPv6 + IPv4
72COLOUR_IPV6 = INDIGO
73COLOUR_IPV4 = PINK
74COLOUR_IPVX = GREY # other
75
76COLOUR_TCP = INDIGO
77COLOUR_UDP = YELLOW
78COLOUR_ICMP = PURPLE
79COLOUR_IGMP = TEAL
80COLOUR_UDPLITE = DEEP_ORANGE
81COLOUR_SCTP = LIGHT_GREEN
82COLOUR_DCCP = LIGHT_BLUE
83COLOUR_OTHER = COLOUR_IPVX
84
85# Processor
86CPU_USER = LIGHT_GREEN
87CPU_NICE = BLUE
88CPU_SYS = RED
89CPU_WAIT = DEEP_PURPLE
90CPU_IRQ = ORANGE
91CPU_SIRQ = YELLOW
92CPU_IDLE = LIGHT_GREY
93
94# Memory
95MEMORY_USED = GREEN
96MEMORY_BUFFERED = BLUE
97MEMORY_CACHED = YELLOW
98MEMORY_SWAP = RED
99
100# Load average
101LOAD_AVG_COLOURS = (
102 RED, # 1m
103 ORANGE, # 5m
104 YELLOW, # 15m
105)
106
107COLOURS_PROTOCOL_STATES = {
108 # General states
109 "NONE" : GREY,
110 "TIME_WAIT" : AMBER,
111
112 # TCP
113 "CLOSE" : BLACK,
114 "CLOSE_WAIT" : util.lighten(BLACK, 0.25),
115 "ESTABLISHED" : LIGHT_GREEN,
116 "FIN_WAIT" : ORANGE,
117 "LAST_ACK" : PURPLE,
118 "SYN_RECV" : CYAN,
119 "SYN_SENT" : TEAL,
120 "SYN_SENT2" : AMBER,
121
122 # DCCP
123 "CLOSEREQ" : util.lighten(BLACK, 0.5),
124 "CLOSING" : util.lighten(BLACK, 0.25),
125 "IGNORE" : WHITE,
126 "INVALID" : RED,
127 "OPEN" : LIGHT_GREEN,
128 "PARTOPEN" : YELLOW,
129 "REQUEST" : CYAN,
130 "RESPOND" : TEAL,
29455c5f 131
03ba5630
MT
132 # SCTP
133 "CLOSED" : BLACK,
134 "COOKIE_ECHOED" : AMBER,
135 "COOKIE_WAIT" : CYAN,
136 "SHUTDOWN_ACK_SENT" : TEAL,
137 "SHUTDOWN_RECD" : PURPLE,
138 "SHUTDOWN_SENT" : LIGHT_BLUE,
139}