MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / ColorCode

Function ColorCode

src/__init__.py:22107–22122  ·  view source on GitHub ↗
(c: typing.Union[list, tuple, float, None], f: str)

Source from the content-addressed store, hash-verified

22105
22106
22107def ColorCode(c: typing.Union[list, tuple, float, None], f: str) -> str:
22108 if not c:
22109 return ""
22110 if hasattr(c, "__float__"):
22111 c = (c,)
22112 CheckColor(c)
22113 if len(c) == 1:
22114 s = _format_g(c[0]) + " "
22115 return s + "G " if f == "c" else s + "g "
22116
22117 if len(c) == 3:
22118 s = _format_g(tuple(c)) + " "
22119 return s + "RG " if f == "c" else s + "rg "
22120
22121 s = _format_g(tuple(c)) + " "
22122 return s + "K " if f == "c" else s + "k "
22123
22124
22125def Page__add_text_marker(self, quads, annot_type):

Callers 7

color_stringMethod · 0.85
insert_textMethod · 0.85
insert_textboxMethod · 0.85
finishMethod · 0.85
insert_textMethod · 0.85
insert_textboxMethod · 0.85
finishMethod · 0.85

Calls 2

CheckColorFunction · 0.85
_format_gFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…