[latex3-commits] [git/LaTeX3-latex3-latex3] master: Correct range for "HSB" color model (98353069b)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Aug 10 19:18:41 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/98353069b5d2112ccfe86483c9e1063854bea45a

>---------------------------------------------------------------

commit 98353069b5d2112ccfe86483c9e1063854bea45a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Aug 10 18:18:41 2020 +0100

    Correct range for  "HSB" color model
    
    Looking back at xcolor, it uses 0-240 here.


>---------------------------------------------------------------

98353069b5d2112ccfe86483c9e1063854bea45a
 l3experimental/CHANGELOG.md                     |  3 +++
 l3experimental/l3color/l3color.dtx              | 11 +++++------
 l3experimental/l3color/testfiles/m3color002.tlg |  2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/l3experimental/CHANGELOG.md b/l3experimental/CHANGELOG.md
index b2a6f8303..5a1c06dee 100644
--- a/l3experimental/CHANGELOG.md
+++ b/l3experimental/CHANGELOG.md
@@ -12,6 +12,9 @@ this project uses date-based 'snapshot' version identifiers.
 - Support for `hsb` color model
 - Support for `wave` color model
 
+### Fixed
+- Integer range for `HSB` color model
+
 ## [2020-08-07]
 
 ### Changed
diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index 8601156ff..29b26475b 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -84,9 +84,8 @@
 %   \item \texttt{Hsb} Hue-saturation-brightness color, with three axes, integer
 %     in the range $[0,360]$ for hue, real values in the range $[0,1]$ for
 %     saturation and brightness
-%   \item \texttt{HSB} Hue-saturation-brightness color, with three axes, integer
-%     in the range $[0,360]$ for hue, integer values in the range $[0,255]$ for
-%     saturation and brightness
+%   \item \texttt{HSB} Hue-saturation-brightness color, with three axes, integers
+%     in the range $[0,240]$ for hue, saturation and brightness
 %   \item \texttt{HTML} HTML format representation of RGB color given as a
 %     single six-digit hexadecimal number
 %   \item \texttt{RGB} Red-green-blue color, with three axes, one for each of
@@ -927,9 +926,9 @@
 \cs_new:Npn \@@_parse_model_HSB:w #1 , #2 , #3 , #4 \s_@@_stop
   {
     \exp_args:Neee \@@_parse_model_hsb:nnn
-      { \fp_eval:n {#1 / 360} }
-      { \fp_eval:n {#2 / 255} }
-      { \fp_eval:n {#3 / 255} }
+      { \fp_eval:n {#1 / 240} }
+      { \fp_eval:n {#2 / 240} }
+      { \fp_eval:n {#3 / 240} }
   }
 \cs_new:Npn \@@_parse_model_HTML:w #1 , #2 \s_@@_stop
   { \@@_parse_model_HTML_aux:w #1 0 0 0 0 0 0 \s_@@_stop }
diff --git a/l3experimental/l3color/testfiles/m3color002.tlg b/l3experimental/l3color/testfiles/m3color002.tlg
index 30ac03daa..042cfaf8e 100644
--- a/l3experimental/l3color/testfiles/m3color002.tlg
+++ b/l3experimental/l3color/testfiles/m3color002.tlg
@@ -174,7 +174,7 @@ TEST 5: Integer/integer-like models
 ============================================================
 The color foo1 has the properties:
 >  model  =>  rgb
->  rgb  =>  0.0392156862745098 0.03845 0.03768.
+>  rgb  =>  0.04166666666666667 0.04123 0.03993.
 <recently read> }
 l. ...  }
 The color foo1 has the properties:





More information about the latex3-commits mailing list.