conor909
conor909

Reputation: 1623

What color format is pdf-lib using?

What color format is pdf-lib using? Writing rgb(156, 132, 678) or cmyk(157, 145, 124, 135) throws an error where all number values must be between 0 and 1.

How do I convert standard rgb, ie. 0-255 to whatever format this is?

The docs give me the TypeScript definitions of the function but no explanations.

Upvotes: 6

Views: 4737

Answers (1)

August Guenther
August Guenther

Reputation: 161

Documentation gives an example like this color: rgb(0.95, 0.1, 0.1). Dividing by 255 is likely the solution.

Upvotes: 9

Related Questions