1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Extend foreground_color() utility to support custom dark/light colors

This commit is contained in:
jeremystretch
2021-07-15 13:59:14 -04:00
parent 89662124e5
commit c5178fd90e
2 changed files with 8 additions and 5 deletions

View File

@@ -342,7 +342,7 @@ class CableTraceSVG:
for i, label in enumerate(labels):
self.cursor += LINE_HEIGHT
text_coords = (self.center, self.cursor - LINE_HEIGHT / 2)
text_color = f'#{foreground_color(color)}'
text_color = f'#{foreground_color(color, dark="303030")}'
text = Text(label, insert=text_coords, fill=text_color, class_='bold' if not i else [])
link.add(text)