We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59001f6 commit cf904feCopy full SHA for cf904fe
src/structurizr/view/color.py
@@ -20,10 +20,10 @@
20
21
22
class Color(pydantic.color.Color):
23
+ """Represent a natural color."""
24
+
25
def as_hex(self) -> str:
- """
- Hex string representing the color
26
+ """Return a six character hex representation of the color."""
27
values = [pydantic.color.float_to_255(c) for c in self._rgba[:3]]
28
if self._rgba.alpha is not None:
29
values.append(pydantic.color.float_to_255(self._rgba.alpha))
@@ -32,4 +32,5 @@ def as_hex(self) -> str:
32
return "#" + as_hex
33
34
def __str__(self) -> str:
35
+ """Return a hex string representation of the color."""
36
return self.as_hex()
0 commit comments