From 994b9922a8fb65e28922e59f684af69b08a885b9 Mon Sep 17 00:00:00 2001 From: Gustavo Arnosti Neves Date: Thu, 9 Aug 2018 06:33:48 -0300 Subject: [PATCH] v2.4.1 - Backgrounding2 - RGB fix; rgb processing is now fixed on 255-based numbers which are converted internally to percentage-based numbers; there is currently no way to pass percentage-based RGB directly; should implement color-hsb param to use with RGB; edited help and readme to say we need 255-based numbers for RGB. CMYK mode is preferred over any other. --- pdfScale.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pdfScale.sh b/pdfScale.sh index 2229ddd..4dc4801 100755 --- a/pdfScale.sh +++ b/pdfScale.sh @@ -1259,9 +1259,9 @@ parseCMYKBackground() { # Just loads the RGB Vars (without testing anything) loadRGBVars(){ - local rP="$(rgbToPercentage $1)" - local gP="$(rgbToPercentage $2)" - local bP="$(rgbToPercentage $3)" + local rP="$(rgbToPercentage $1)" + local gP="$(rgbToPercentage $2)" + local bP="$(rgbToPercentage $3)" BACKGROUNDCOLOR="$rP $gP $bP" BACKGROUNDCALL="$BACKGROUNDCOLOR setrgbcolor clippath fill " # the space at the end is important! BACKGROUNDTYPE="RGB" @@ -1270,7 +1270,7 @@ loadRGBVars(){ # Converts 255-based RGB to Percentage rgbToPercentage() { - local per=$(echo "scale=8; $1 / 255" | "$BCBIN") + local per=$(echo "scale=8; $1 / 255" | "$BCBIN") printf '%.7f' "$per" # Print rounded conversion } @@ -2120,7 +2120,7 @@ Parameters: Default: 300 --background-gray Creates a background with a gray color setting - Percentage is a floating point percentage number between 0(white) and 1(black) + Percentage is a floating point percentage number between 0(black) and 1(white) --background-cmyk <\"C M Y K\"> Creates a background with a CMYK color setting Must be quoted into a single parameter as in \"0.2 0.2 0.2 0.2\"