<p>Fix CVD rules: they were incorrect in the last update.</p>

<p>Update test vectors after CVD fix.</p>

<p>Add note about floating-point modulo operator implementation interoperability.</p>

</remark>

</revision>

<revision>

<version>0.5</version>

<date>2018-10-01</date>

@ -151,13 +161,14 @@
@@ -151,13 +161,14 @@

<p>Input: Hue angle.</p>

<p>Output: Hue angle.</p>

<p>Note: This algorithm will re-map the angle to map it away from ranges which can not be distinguished by people with the respective &cvds;.</p>

<p>Note: Some floating-point modulo implementations will return negative outputs for negative inputs. This algorithm assumes that your implementation returns <em>non-negative</em> outputs for all inputs.</p>

<p>Add 90 to the angle, take it modulo 180 and subtract 90. Take the result modulo 360 to ensure that it's in the range from 0 to 360.</p>

<p>Note: the same effect can be achieved by forcing the two most-significant bits of the angle to be equal to the second-most-significant bit before converting to a float in <linkurl="#algorithm-angle">Angle generation</link>. This avoids having to perform a floating-point modulo operation.</p>

<p>Subtract 90 from the angle, take the result modulo 180.</p>

<p>Note: the same effect can be achieved by setting the second-most-significant bit of the angle to the inverse of the most-significant bit and then setting the most-significant bit to zero before conversion to floating point in <linkurl="#algorithm-angle">Angle generation</link>. This avoids having to perform a floating-point modulo operation.</p>

<p>Take the angle modulo 180.</p>

<p>Note: the same effect can be achieved by setting the most-significant bit to zero before conversion to floating point in <linkurl="#algorithm-angle">Angle generation</link>. This avoids having to perform a floating-point modulo operation.</p>

</section3>

</section2>

<section2topic='Adapting the Color for specific Background Colors'anchor='algorithm-bg'>

@ -298,54 +309,54 @@ bc = 0.2*bb_inv + 0.8*bi;]]></code></li>
@@ -298,54 +309,54 @@ bc = 0.2*bb_inv + 0.8*bi;]]></code></li>

<p>This section holds test vectors for the different configurations. The test vectors are provided as Comma Separated Values. Strings are enclosed by single quotes ('). The first line contains a header. Each row contains, in that order, the original text, the text encoded as UTF-8 as hexadecimal octets, the angle in degrees, the calculated hue in degrees (differs from angle only for CVD-corrected rows), and the Red, Green, and Blue values.</p>

<section2topic='Test Vectors for mapping to 216 color palette'anchor='testvectors-palette'>

<p>The used palette can be generated by sampling the RGB cube evenly with six samples on each axis (resulting in 210 colors (grayscales are excluded)). The resulting palette is commonly known as the palette of so-called "Web Safe" colors.</p>