diff --git a/README.md b/README.md index dcbf3e7..18294c0 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ See the [documentation](https://docs.derpyenterprises.org/#/leeks) [Stack Overflow](https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb) - Hex support -and all the contributors <3 +and all the contributors! \ No newline at end of file diff --git a/lib/data/Colours.ts b/lib/data/Colours.ts index d3941f4..e0cb576 100644 --- a/lib/data/Colours.ts +++ b/lib/data/Colours.ts @@ -1,4 +1,5 @@ enum colours { + // Default black = 30, red = 31, green = 32, @@ -17,6 +18,7 @@ enum colours { magentaBright = 95, cyanBright = 96, whiteBright = 97, + // Background bgBlack = 40, bgRed = 41, bgGreen = 42, diff --git a/lib/data/Styles.ts b/lib/data/Styles.ts index c51fa60..293af2a 100644 --- a/lib/data/Styles.ts +++ b/lib/data/Styles.ts @@ -1,16 +1,20 @@ enum styles { reset = 0, + // Styles bold = 1, dim = 2, italic = 3, underline = 4, + overline = 53, blink = 5, inverse = 7, strikethrough = 9, hidden = 8, shown = 28, + // Remove styles nostrikethrough = 29, nounderline = 24, + nooverline = 55, noblink = 25, noinverse = 27 } diff --git a/lib/index.ts b/lib/index.ts index 055e985..cabefb9 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -18,7 +18,7 @@ for (let s in Styles) styles[s] = (t: string) => `\x1b[${Styles[s]}m${t}\x1b[0m` * Check if colours are supported. * @credit [Colorette](https://github.com/jorgebucaran/colorette) */ -let supports:string | boolean = !('NO_COLOR' in process.env) && process.env.FORCE_COLOR !== '0' && (process.env.FORCE_COLOR || process.platform === 'win32' || (process.stdout.isTTY && process.env.TERM && process.env.TERM !== 'dumb')); +let supports: string | boolean = !('NO_COLOR' in process.env) && process.env.FORCE_COLOR !== '0' && (process.env.FORCE_COLOR || process.platform === 'win32' || (process.stdout.isTTY && process.env.TERM && process.env.TERM !== 'dumb')); /** * Change the colour of the given text using 8-bit colours. diff --git a/package.json b/package.json index 55bf596..5031b56 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,6 @@ "256" ], "devDependencies": { - "@types/node": "^14.14.16" + "@types/node": "^14.14.31" } } diff --git a/test.js b/test.js index 24941b0..440753c 100644 --- a/test.js +++ b/test.js @@ -10,11 +10,11 @@ console.log(leeks.colors.blue(leeks.styles.underline('Hello!'))); console.log(leeks.colours.grey('Hello!')); console.log(leeks.colors.gray('Hello!')); -console.log(leeks.eightBit('32', 'hello')); -console.log(leeks.eightBitBg('32', 'hello')); +console.log(leeks.eightBit(32, 'hello')); +console.log(leeks.eightBitBg(32, 'hello')); -console.log(leeks.rgb(['114', '137', '218'], 'hello')); -console.log(leeks.rgbBg(['114', '137', '218'], 'hello')); +console.log(leeks.rgb([114, 137, 218], 'hello')); +console.log(leeks.rgbBg([114, 137, 218], 'hello')); console.log(leeks.hex('#7289da', 'hello')); console.log(leeks.hexBg('#7289da', 'hello')); \ No newline at end of file