|
82 | 82 | </p> |
83 | 83 | <h1 class="p-name no-ref" id=title>CSS Color Module Level 4</h1> |
84 | 84 | <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft, |
85 | | - <span class=dt-updated><span class=value-title title=20140714>14 July 2014</span></span></span></h2> |
| 85 | + <span class=dt-updated><span class=value-title title=20140715>15 July 2014</span></span></span></h2> |
86 | 86 | <div data-fill-with=spec-metadata><dl> |
87 | 87 | <dt>This version: |
88 | 88 | <dd><a class=u-url href=http://dev.w3.org/csswg/css-color/>http://dev.w3.org/csswg/css-color/</a> |
@@ -1884,19 +1884,19 @@ <h3 class="heading settled heading" data-level=9.1 id=cmyk-rgb><span class=secno |
1884 | 1884 | Otherwise:</p> |
1885 | 1885 |
|
1886 | 1886 | <ul> |
1887 | | - <li><code>red = 1.0 - min(1.0, cyan + black)</code> |
1888 | | - <li><code>green = 1.0 - min(1.0, magenta + black)</code> |
1889 | | - <li><code>blue = 1.0 - min(1.0, yellow + black)</code> |
| 1887 | + <li><code>red = 1 - min(1, cyan * (1 - black) + black)</code> |
| 1888 | + <li><code>green = 1 - min(1, magenta * (1 - black) + black)</code> |
| 1889 | + <li><code>blue = 1 - min(1, yellow * (1 - black) + black)</code> |
1890 | 1890 | <li>Alpha is same as for input color. |
1891 | 1891 | </ul> |
1892 | 1892 |
|
1893 | 1893 | <p>To <dfn data-dfn-type=dfn data-noexport="" id=naively-convert-from-rgba-to-cmyk title="naively convert from RGBA to CMYK | naively converted to CMYK">naively convert from RGBA to CMYK<a class=self-link href=#naively-convert-from-rgba-to-cmyk></a></dfn>:</p> |
1894 | 1894 |
|
1895 | 1895 | <ul> |
1896 | | - <li>k = 1 - max(r, g, b) |
1897 | | - <li>c = (1 - r - k) / (1 - k), or 0 if k is 1 |
1898 | | - <li>m = (1 - g - k) / (1 - k), or 0 if k is 1 |
1899 | | - <li>y = (1 - b - k) / (1 - k), or 0 if k is 1 |
| 1896 | + <li>black = 1 - max(red, green, blue) |
| 1897 | + <li>cyan = (1 - red - black) / (1 - black), or 0 if black is 1 |
| 1898 | + <li>magenta = (1 - green - black) / (1 - black), or 0 if black is 1 |
| 1899 | + <li>yellow = (1 - blue - black) / (1 - black), or 0 if black is 1 |
1900 | 1900 | <li>alpha is the same as the input color |
1901 | 1901 | <li>fallback color must be set to the input color |
1902 | 1902 | </ul> |
@@ -3098,9 +3098,10 @@ <h3 class="heading settled heading" data-level=15.4 id=api-CMYKColor><span class |
3098 | 3098 | Defined as follows in ECMAScript: |
3099 | 3099 |
|
3100 | 3100 | <pre>function() { |
3101 | | - const r = 1 - Math.min(1, this.c + this.k); |
3102 | | - const g = 1 - Math.min(1, this.m + this.k); |
3103 | | - const b = 1 - Math.min(1, this.y + this.k); |
| 3101 | + const k_ = 1 - this.k; |
| 3102 | + const r = 1 - Math.min(1, this.c * k_ + this.k); |
| 3103 | + const g = 1 - Math.min(1, this.m * k_ + this.k); |
| 3104 | + const b = 1 - Math.min(1, this.y * k_ + this.k); |
3104 | 3105 | return new RGBColor(r, g, b, this.a); |
3105 | 3106 | } |
3106 | 3107 | </pre> |
|
0 commit comments