* Add theme graph colors

* Fix graph not applying colors
This commit is contained in:
Alfredo Monclus 2021-12-07 22:56:32 -03:00 committed by jordanruthe
parent d21e9cbfaa
commit 2a9e653505
6 changed files with 102 additions and 2 deletions

View File

@ -452,8 +452,6 @@ class KlipperScreen(Gtk.Window):
style_options = json.load(f)
f.close()
self.gtk.color_list = style_options['graph_colors']
if os.path.exists(klipperscreendir + "/styles/%s/style.conf" % (self.theme)):
try:
f = open(klipperscreendir + "/styles/%s/style.conf" % (self.theme))
@ -462,6 +460,8 @@ class KlipperScreen(Gtk.Window):
except Exception:
logging.error("Unable to parse custom template conf file.")
self.gtk.color_list = style_options['graph_colors']
for i in range(len(style_options['graph_colors']['extruder']['colors'])):
num = "" if i == 0 else i+1
css_data += "\n.graph_label_extruder%s {border-left-color: #%s}" % (

View File

@ -0,0 +1,20 @@
{
"graph_colors": {
"extruder": {
"colors": ["DC322F", "B58900", "CB4B16", "AA1F1D", "973911"],
"state": 0
},
"bed": {
"colors": ["268BD2"],
"state": 0
},
"fan": {
"colors": ["859900", "2AA198", "637300", "1F7A72"],
"state": 0
},
"sensor": {
"colors": ["D33682", "6C71C4", "C06CC4", "6D26D1", "2A34A1"],
"state": 0
}
}
}

View File

@ -0,0 +1,20 @@
{
"graph_colors": {
"extruder": {
"colors": ["C62828", "9C27B0", "F06292", "F44336", "6A1B9A"],
"state": 0
},
"bed": {
"colors": ["00B0FF"],
"state": 0
},
"fan": {
"colors": ["558B2F", "8BC34A", "00695C", "009688"],
"state": 0
},
"sensor": {
"colors": ["FF8F00", "3F51B5", "9E9D24", "CDDC39", "FFC107"],
"state": 0
}
}
}

View File

@ -0,0 +1,20 @@
{
"graph_colors": {
"extruder": {
"colors": ["C62828", "9C27B0", "F06292", "F44336", "6A1B9A"],
"state": 0
},
"bed": {
"colors": ["00B0FF"],
"state": 0
},
"fan": {
"colors": ["558B2F", "8BC34A", "00695C", "009688"],
"state": 0
},
"sensor": {
"colors": ["FF8F00", "3F51B5", "9E9D24", "CDDC39", "FFC107"],
"state": 0
}
}
}

View File

@ -0,0 +1,20 @@
{
"graph_colors": {
"extruder": {
"colors": ["C62828", "9C27B0", "F06292", "F44336", "6A1B9A"],
"state": 0
},
"bed": {
"colors": ["00B0FF"],
"state": 0
},
"fan": {
"colors": ["558B2F", "8BC34A", "00695C", "009688"],
"state": 0
},
"sensor": {
"colors": ["FF8F00", "3F51B5", "9E9D24", "CDDC39", "FFC107"],
"state": 0
}
}
}

20
styles/z-bolt/style.conf Normal file
View File

@ -0,0 +1,20 @@
{
"graph_colors": {
"extruder": {
"colors": ["ED6500", "ED8500", "EDA500", "EDC500", "EDF500"],
"state": 0
},
"bed": {
"colors": ["009384"],
"state": 0
},
"fan": {
"colors": ["A7E100", "7ECE21", "AAA920", "AC7140"],
"state": 0
},
"sensor": {
"colors": ["B10080", "7800B0", "AC4958", "B1A080", "B1C080"],
"state": 0
}
}
}