Skip to content

Commit cf904fe

Browse files
committed
docs: expand docstrings
1 parent 59001f6 commit cf904fe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/structurizr/view/color.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121

2222
class Color(pydantic.color.Color):
23+
"""Represent a natural color."""
24+
2325
def as_hex(self) -> str:
24-
"""
25-
Hex string representing the color
26-
"""
26+
"""Return a six character hex representation of the color."""
2727
values = [pydantic.color.float_to_255(c) for c in self._rgba[:3]]
2828
if self._rgba.alpha is not None:
2929
values.append(pydantic.color.float_to_255(self._rgba.alpha))
@@ -32,4 +32,5 @@ def as_hex(self) -> str:
3232
return "#" + as_hex
3333

3434
def __str__(self) -> str:
35+
"""Return a hex string representation of the color."""
3536
return self.as_hex()

0 commit comments

Comments
 (0)