MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / color_text

Method color_text

src/__init__.py:2355–2362  ·  view source on GitHub ↗
(color)

Source from the content-addressed store, hash-verified

2353
2354 @staticmethod
2355 def color_text(color):
2356 if type(color) is str:
2357 return color
2358 if type(color) is int:
2359 return f"rgb({sRGB_to_rgb(color)})"
2360 if type(color) in (tuple, list):
2361 return f"rgb{tuple(color)}"
2362 return color
2363
2364 def create_element( self, tag):
2365 return Xml( mupdf.fz_dom_create_element( self.this, tag))

Callers 2

set_bgcolorMethod · 0.95
set_colorMethod · 0.95

Calls 1

sRGB_to_rgbFunction · 0.85

Tested by

no test coverage detected