Skip to content

Commit

Permalink
fixes #56 ; HSL -> HEX colors
Browse files Browse the repository at this point in the history
  • Loading branch information
drom committed Feb 22, 2024
1 parent a1194a4 commit 5a72dfe
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ const tt = (x, y, obj) => Object.assign(
);

const colors = { // TODO compare with WaveDrom
2: 0,
3: 80,
4: 170,
5: 45,
6: 126,
7: 215
2: '#ff0000', // 'hsl(0,100%,50%)'
3: '#aaff00', // 'hsl(80,100%,50%)'
4: '#00ffd5', // 'hsl(170,100%,50%)'
5: '#ffbf00', // 'hsl(45,100%,50%)'
6: '#00ff19', // 'hsl(126,100%,50%)'
7: '#006aff' // 'hsl(215,100%,50%)'
};

const typeStyle = t => (colors[t] !== undefined)
? ';fill:hsl(' + colors[t] + ',100%,50%)'
: '';
const typeStyle = t => (colors[t] !== undefined) ? ';fill:' + colors[t] : '';

const norm = (obj, other) => Object.assign(
Object
Expand Down

0 comments on commit 5a72dfe

Please sign in to comment.