55 // make 7 steps in sRGB, compare to 7 steps in D65-adapted lab
66 // odd number of steps so we have an exact 50%
77
8- for ( var i = 0 ; i < 7 ; i ++ ) {
9- console . log ( i > 0 ? 100 * 7 / i : 0 ) ;
8+ for ( var i = 0 ; i < 8 ; i ++ ) {
9+ console . log ( 100 * i / 7 ) ;
10+ }
11+ for ( var i = 0 ; i < 8 ; i ++ ) {
12+ var lab = [ 100 * i / 7 , 0 , 0 ] ;
13+ // console.log(lab);
14+ console . log ( i ) ;
15+ var xyz = Lab_to_XYZ ( lab ) ;
16+ // okay, bradford
17+ var xyz2 = D50_to_D65 ( xyz ) ;
18+ var linrgb = XYZ_to_lin_sRGB ( xyz2 ) ;
19+ console . log ( linrgb ) ;
20+ var rgb = gam_sRGB ( linrgb ) ;
21+ console . log ( rgb ) ;
1022 }
1123 </ script >
24+ < style >
25+ # rgb {background : # 777 ; padding : 20px }
26+ # rgb div {width : 60px ; height : 60px ; display : inline-block; padding : 10px ; }
27+ </ style >
28+ < div id ="rgb ">
29+ < div style ="background-color:rgb(0,0,0) "> </ div >
30+ < div style ="background-color:rgb(14.285714285714286%, 14.285714285714286%, 14.285714285714286%) "> </ div >
31+ < div style ="background-color:rgb(28.571428571428573%, 28.571428571428573%, 28.571428571428573%) "> </ div >
32+ < div style ="background-color:rgb(42.857142857142854%, 42.857142857142854%, 42.857142857142854%) "> </ div >
33+ < div style ="background-color:rgb(57.142857142857146%, 57.142857142857146%, 57.142857142857146%) "> </ div >
34+ < div style ="background-color:rgb(71.42857142857143%, 71.42857142857143%, 71.42857142857143%) "> </ div >
35+ < div style ="background-color:rgb(85.71428571428571%, 85.71428571428571%, 85.71428571428571%) "> </ div >
36+ < div style ="background-color:rgb(100%, 100%, 100%) "> </ div >
37+ </ div >
38+ < div id ="lab ">
39+ < div style ="background-color:rgb(0,0,0) "> </ div >
40+ < div style ="background-color:rgb(14.285714285714286%, 14.285714285714286%, 14.285714285714286%) "> </ div >
41+ < div style ="background-color:rgb(28.571428571428573%, 28.571428571428573%, 28.571428571428573%) "> </ div >
42+ < div style ="background-color:rgb(42.857142857142854%, 42.857142857142854%, 42.857142857142854%) "> </ div >
43+ < div style ="background-color:rgb(57.142857142857146%, 57.142857142857146%, 57.142857142857146%) "> </ div >
44+ < div style ="background-color:rgb(71.42857142857143%, 71.42857142857143%, 71.42857142857143%) "> </ div >
45+ < div style ="background-color:rgb(85.71428571428571%, 85.71428571428571%, 85.71428571428571%) "> </ div >
46+ < div style ="background-color:rgb(100%, 100%, 100%) "> </ div >
47+ </ div >
1248</ html >
0 commit comments