ci: change default fabric print grey level from 15% to 10%
Change-Id: I07f69dc4a42c1b481cae687eed7187bb8775e09b
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 472002e..4d0ef97 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -207,7 +207,7 @@
- export PDF=target/$(basename $SOURCE_FILE .Rmd).pdf
- ./ci/html2pdf $HTML $PDF 1
# Variant for printing on fabric, where solid black bleeds out: replace all
- # vector black by 15% grey (keeps QR codes scannable and text crisp).
+ # vector black by 10% grey (keeps QR codes scannable and text crisp).
- export FABRIC_PDF=target/$(basename $SOURCE_FILE .Rmd)_fabric.pdf
- ./ci/pdf-lighten-black $PDF $FABRIC_PDF
# Add 10 mm of blank material on every side for mounting the fabric poster.
diff --git a/README.md b/README.md
index 627e065..87f39a7 100644
--- a/README.md
+++ b/README.md
@@ -100,10 +100,10 @@
## Printing on fabric
-When printing on light fabric, solid black tends to bleed out, making QR codes hard to scan and text fuzzy. [ci/pdf-lighten-black](./ci/pdf-lighten-black) produces a variant of a finished PDF in which all vector black is replaced by a dark grey (default 15%, configurable), while text and graphics stay vector and embedded raster images are untouched:
+When printing on light fabric, solid black tends to bleed out, making QR codes hard to scan and text fuzzy. [ci/pdf-lighten-black](./ci/pdf-lighten-black) produces a variant of a finished PDF in which all vector black is replaced by a dark grey (default 10%, configurable), while text and graphics stay vector and embedded raster images are untouched:
```bash
-ci/pdf-lighten-black poster.pdf poster_fabric.pdf # 15% grey
+ci/pdf-lighten-black poster.pdf poster_fabric.pdf # 10% grey
ci/pdf-lighten-black poster.pdf poster_fabric.pdf 0.25 # lighter, if black still bleeds
```
diff --git a/ci/pdf-lighten-black b/ci/pdf-lighten-black
index e24b565..390e6ca 100755
--- a/ci/pdf-lighten-black
+++ b/ci/pdf-lighten-black
@@ -2,7 +2,7 @@
# pdf-lighten-black IN.pdf [OUT.pdf] [GREY]
#
# Produce a copy of IN.pdf in which all *vector* pure black is replaced by a
-# dark grey (default 15% = #262626). Intended for printing on fabric, where
+# dark grey (default 10% = #1a1a1a). Intended for printing on fabric, where
# solid black ink bleeds out, making QR codes hard to scan and text fuzzy.
#
# Works on the PDF content streams directly (qpdf QDF round-trip), so text
@@ -10,11 +10,11 @@
# file works at any print resolution. Colors inside embedded raster images
# (e.g. screenshots) are not touched.
#
-# GREY is the target grey level in [0,1) per RGB channel (0.15 = 15% = #262626).
+# GREY is the target grey level in [0,1) per RGB channel (0.10 = 10% = #1a1a1a).
in=$1
out=${2:-${in%.pdf}_fabric.pdf}
-grey=${3:-0.15}
+grey=${3:-0.10}
k=$(awk -v g="$grey" 'BEGIN { printf "%.4g", 1 - g }')