File tree Expand file tree Collapse file tree 5 files changed +104
-1
lines changed
hsl-tables-for-color-3-errata Expand file tree Collapse file tree 5 files changed +104
-1
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en " >
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > CodePen - HSL tables for Color 3 errata</ title >
6+ < link rel ="stylesheet " href ="./style.css ">
7+
8+ </ head >
9+ < body >
10+ <!-- partial:index.partial.html -->
11+
12+ <!-- partial -->
13+ < script src ='https://cdnjs.cloudflare.com/ajax/libs/blissfuljs/1.0.6/bliss.min.js '> </ script > < script src ="./script.js "> </ script >
14+
15+ </ body >
16+ </ html >
Original file line number Diff line number Diff line change 1+ $ . ready ( ) . then ( ( ) => {
2+
3+ let steps = {
4+ h : 30 ,
5+ s : 20 ,
6+ l : 10
7+ } ;
8+
9+ let hues = {
10+ "0" : "Reds" ,
11+ "30" : "Reds-Yellows (=Oranges)" ,
12+ "60" : "Yellows" ,
13+ "90" : "Yellow-Greens" ,
14+ "120" : "Greens" ,
15+ "150" : "Green-Cyans" ,
16+ "180" : "Cyans" ,
17+ "210" : "Cyan-Blues" ,
18+ "240" : "blues" ,
19+ "270" : "Blue-Magentas" ,
20+ "300" : "Magentas" ,
21+ "330" : "Magenta-Reds" ,
22+ } ;
23+
24+ let container = $ . create ( "div" ) ;
25+
26+ for ( let h = 0 ; h < 360 ; h += steps . h ) {
27+ let table = $ . create ( "table" , {
28+ innerHTML : `<thead>
29+ <tr>
30+ <th colspan="10">${ h } ° ${ hues [ h ] } </th>
31+ </tr>
32+ <tr>
33+ <th></th>
34+ </tr>
35+ </thead>` ,
36+ inside : container
37+ } ) ;
38+ let satHeader = $ ( "thead tr:last-of-type" , table ) ;
39+
40+ for ( let s = 100 ; s >= 0 ; s -= steps . s ) {
41+ $ . create ( "th" , {
42+ textContent : `${ s } %` ,
43+ inside : satHeader
44+ } ) ;
45+ }
46+
47+ for ( let l = 100 ; l >= 0 ; l -= steps . l ) {
48+ // One row
49+ let tr = $ . create ( "tr" , {
50+ innerHTML : `<th>${ l } %</th>`
51+ } ) ;
52+
53+ //
54+ for ( let s = 100 ; s >= 0 ; s -= steps . s ) {
55+ let td = $ . create ( "td" , {
56+ style : {
57+ "background-color" : `hsl(${ h } ${ s } % ${ l } %)`
58+ } ,
59+ inside : tr
60+ } ) ;
61+ }
62+
63+ table . append ( tr ) ;
64+ }
65+ }
66+
67+ document . body . append ( container ) ;
68+
69+ } ) ;
Original file line number Diff line number Diff line change 1+ body {
2+ background : rgb (46.63% 46.63% 46.63% );
3+ }
4+
5+ div {
6+ display : flex;
7+ flex-flow : row wrap;
8+ justify-content : space-around;
9+ gap : 2em ;
10+ }
11+
12+ table {
13+ table-layout : fixed;
14+ }
15+
16+ td {
17+ padding : .75em ;
18+ }
Original file line number Diff line number Diff line change @@ -713,5 +713,5 @@ Changes
713713
714714<ul>
715715 <li> Removed scary warning notice</li>
716- <li></li>
716+ <li> Added incremental font technology to supports </li>
717717</ul>
You can’t perform that action at this time.
0 commit comments