Skip to content

Commit

Permalink
convert.js
Browse files Browse the repository at this point in the history
  • Loading branch information
V0ltic committed Aug 29, 2021
1 parent 9ba49e2 commit 9af507b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ npm i
node . [R] [G] [B]
```

**Use convert.js instead of index if you don't want to install modules.**

NOTE: Change the "[R] [G] [B]" values to your colours.
21 changes: 21 additions & 0 deletions convert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Logger
*/
function log (msg) {
console.log(msg);
}

var r = process.argv[2];
var g = process.argv[3];
var b = process.argv[4];

if (process.argv.length >= 5) {
r = r / 255;
g = g / 255;
b = b / 255;

log(`Converted: (${r.toFixed(2)}f, ${g.toFixed(2)}f, ${b.toFixed(2)}f)`)
}
else {
log(`Invalid parameters!`);
}

0 comments on commit 9af507b

Please sign in to comment.