diff --git a/palette-gen.js b/palette-gen.js index 6524d41..c565814 100644 --- a/palette-gen.js +++ b/palette-gen.js @@ -1,7 +1,7 @@ #!/bin/nodejs const componentToHex = (c) => ("0" + c.toString(16)).slice(-2); -const rgbToHex = (c) => "#" + componentToHex(c.r) + componentToHex(c.g) + componentToHex(c.b); +const rgbToHex = (c) => componentToHex(c.r) + componentToHex(c.g) + componentToHex(c.b); const hexToRgb = (hex) => { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { @@ -31,5 +31,5 @@ const rl = readline.createInterface({ }); rl.on('line', (line) => { - console.log(parseScheme(line).map(e=>genPalette(e).map(c=>rgbToHex(c)))); + console.log(parseScheme(line).map(e=>genPalette(e).map(c=>rgbToHex(c))).join(",")); });