MCPcopy
hub / github.com/ArtifexSoftware/pdf2docx / cmyk_to_rgb

Function cmyk_to_rgb

pdf2docx/common/share.py:173–179  ·  view source on GitHub ↗

CMYK components to GRB value.

(c:float, m:float, y:float, k:float, cmyk_scale:float=100)

Source from the content-addressed store, hash-verified

171
172
173def cmyk_to_rgb(c:float, m:float, y:float, k:float, cmyk_scale:float=100):
174 '''CMYK components to GRB value.'''
175 r = (1.0 - c / float(cmyk_scale)) * (1.0 - k / float(cmyk_scale))
176 g = (1.0 - m / float(cmyk_scale)) * (1.0 - k / float(cmyk_scale))
177 b = (1.0 - y / float(cmyk_scale)) * (1.0 - k / float(cmyk_scale))
178 res = rgb_to_value([r, g, b]) # type: int
179 return res
180
181
182def rgb_value(components:list):

Callers 1

rgb_valueFunction · 0.85

Calls 1

rgb_to_valueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…