File: widgets.py

package info (click to toggle)
freeorion 0.5.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 194,920 kB
  • sloc: cpp: 186,821; python: 40,979; ansic: 1,164; xml: 721; makefile: 32; sh: 7
file content (15 lines) | stat: -rw-r--r-- 338 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DIFF_ADD = "#36CF70"
DIFF_REMOVE = "#A32929"


def to_hex_color(color):
    r, g, b = color["R"], color["G"], color["B"]
    return f"#{r:02X}{g:02X}{b:02X}"


def span_with_hint(text, hint):
    return f'<span title="{hint}">{text}</span>'


def colored_span(text, hex_color):
    return f'<span style="color:{hex_color}">{text}</span>'