File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -3508,6 +3508,30 @@ unless trailing zeroes have been omitted.
3508
3508
}
3509
3509
</pre>
3510
3510
3511
+ <!--
3512
+ ██████ ███████ ████████ ████████
3513
+ ██ ██ ██ ██ ██ ██ ██
3514
+ ██ ██ ██ ██ ██ ██
3515
+ ██ ██ ██ ██ ██ ██████
3516
+ ██ ██ ██ ██ ██ ██
3517
+ ██ ██ ██ ██ ██ ██ ██
3518
+ ██████ ███████ ████████ ████████
3519
+ -->
3520
+
3521
+ <h2 id="color-conversion-code">
3522
+ Sample code for Color Conversions</h2>
3523
+
3524
+ <em> This section is not normative.</em>
3525
+
3526
+ The naive conversion from device-cmyk is trivial:
3527
+
3528
+ <pre class="include-code lang-javascript">
3529
+ path: naive.js
3530
+ highlight: js
3531
+ </pre>
3532
+
3533
+
3534
+
3511
3535
<!--
3512
3536
██████ ████████ ██████ ██ ██ ████████ ████ ████████ ██ ██
3513
3537
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
Original file line number Diff line number Diff line change
1
+ function naive ( cmyk ) {
2
+ // naively convert an array of CMYK values
3
+ // to sRGB
4
+ let [ cyan , magenta , yellow , black ] = cmyk ;
5
+ let red = 1 - Math . min ( 1 , cyan * ( 1 - black ) + black ) ;
6
+ let green = 1 - Math . min ( 1 , magenta * ( 1 - black ) + black ) ;
7
+ let blue = 1 - Math . min ( 1 , yellow * ( 1 - black ) + black ) ;
8
+ return [ red , green , blue ] ;
9
+ }
You can’t perform that action at this time.
0 commit comments