admin管理员组文章数量:1314573
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.
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.
Share Improve this question edited Nov 8, 2021 at 18:38 conor909 asked Nov 4, 2021 at 15:06 conor909conor909 1,6231 gold badge17 silver badges31 bronze badges 3- 1 Divide the 0...255 value by 255 (or 256 maybe) – Pointy Commented Nov 4, 2021 at 15:10
- 1 standard RGB is not from 0 to 255 (or 256). Max value of 100 or 1 is mon (especially in literature), and we should go back to such normalizations because we may have more bits per channel. In fact some new function start using again RGB which is white (see CSS) – Giao Catenazzi Commented Nov 5, 2021 at 6:12
- 1 @GiaoCatenazzi It's standard in web apis, and this is a javascript library – conor909 Commented Nov 8, 2021 at 17:38
1 Answer
Reset to default 9Documentation gives an example like this color: rgb(0.95, 0.1, 0.1)
. Dividing by 255 is likely the solution.
本文标签: javascriptWhat color format is pdflib usingStack Overflow
版权声明:本文标题:javascript - What color format is pdf-lib using? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741964459a2407467.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论