ref: ed64f04c74a5d28cb2561a181fe4861fd91c4e6b
parent: fa29204bd5df54b40e2f0f81cca94e55dcfb801c
author: Ali Gholami Rudi <ali@rudi.ir>
date: Tue Mar 27 15:16:44 EDT 2018
pdf: text colour
--- a/pdf.c
+++ b/pdf.c
@@ -240,7 +240,12 @@
static void out_fontup(void)
{
if (o_m != p_m) {
+ int r = CLR_R(o_m) * 1000 / 255;
+ int g = CLR_G(o_m) * 1000 / 255;
+ int b = CLR_B(o_m) * 1000 / 255;
o_flush();
+ sbuf_printf(pg, "%d.%03d %d.%03d %d.%03d rg\n",
+ r / 1000, r % 100, g / 1000, g % 1000, b / 1000, b % 1000);
p_m = o_m;
}
if (o_pf != p_pf || o_s != p_s) {