Skip to content

Commit

Permalink
Use softer cell colours to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
gskorokhod committed Nov 17, 2023
1 parent 25814d9 commit 064f173
Show file tree
Hide file tree
Showing 4 changed files with 197,696 additions and 197,688 deletions.
7 changes: 7 additions & 0 deletions tools/essence-feature-usage-stats/utils/colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ def as_hex(self) -> str:
"""Get the colour value as a hex string."""
return Colour.rgb_to_hex(self.as_rgb())

def get_rgb_css_string(self, a=1.0) -> str:
"""Get CSS colour string as RGB(A): e.g. rgba(255,255,255,0.5)."""
if a < 1.0: # noqa: PLR2004
rgba = (*self.as_rgb(), a)
return "rgba" + str(rgba)
return "rgb" + str(self.as_rgb())

def __str__(self) -> str: # noqa: D105
return self.as_hex()

Expand Down
Loading

0 comments on commit 064f173

Please sign in to comment.