MCPcopy
hub / github.com/Textualize/rich / __rich__

Method __rich__

rich/color.py:315–324  ·  view source on GitHub ↗

Displays the actual color if Rich printed.

(self)

Source from the content-addressed store, hash-verified

313 """A triplet of color components, if an RGB color."""
314
315 def __rich__(self) -> "Text":
316 """Displays the actual color if Rich printed."""
317 from .style import Style
318 from .text import Text
319
320 return Text.assemble(
321 f"<color {self.name!r} ({self.type.name.lower()})",
322 ("⬤", Style(color=self)),
323 " >",
324 )
325
326 def __rich_repr__(self) -> Result:
327 yield self.name

Callers

nothing calls this directly

Calls 2

StyleClass · 0.85
assembleMethod · 0.80

Tested by

no test coverage detected