Skip to content

Commit 0b206bc

Browse files
committed
start ugly hack
1 parent 2de236d commit 0b206bc

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

css-color/matrixmaker.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Make matrices for converting to and from an arbitrary RGB colorspace,
2+
// given the x,y chromaticities of red, green, blue and white.
3+
// To use these matrices, the RGB components are assumed be be
4+
// linearized and in the range 0 to 1.
5+
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
6+
7+
// Horribly hacky, non interactive utility. Edit the file to pick
8+
// another colorspace and read the results from the console :P
9+
10+
<html>
11+
<script src="math.js"></script>
12+
<script>
13+
// these are for ITU Rec BT.2020
14+
const xred=0.708 ;
15+
const yred=0.292 ;
16+
17+
const xgreen=0.170 ;
18+
const ygreen=0.797 ;
19+
20+
const xblue=0.131 ;
21+
const yblue=0.046 ;
22+
23+
// D65
24+
const xwhite=0.3127 ;
25+
const ywhite=0.3290 ;
26+
27+
28+
</script>
29+
</html>

0 commit comments

Comments
 (0)