Skip to content

Commit

Permalink
feat: getColorDepth >= 8
Browse files Browse the repository at this point in the history
  • Loading branch information
FliPPeDround committed Jul 19, 2023
1 parent c3bf9af commit 1c6f0f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<a href="https://www.npmjs.com/package/create-uni"><img src="https://img.shields.io/npm/v/create-uni?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
</p>

<h2 align="center">
<sub>>_ Easy to use create uni▌</sub>
</h2>

# 📦 使用

```shell
Expand Down
6 changes: 3 additions & 3 deletions src/utils/banners.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { green } from 'kolorist'
import { lightCyan } from 'kolorist'

/* eslint-disable no-console */
export function printBanner() {
Expand All @@ -16,9 +16,9 @@ export function printBanner() {
colorText += `\x1B[38;2;${red};${green};${blue}m${text[i]}\x1B[0m`
}

const output = process.stdout.isTTY && process.stdout.getColorDepth() > 8
const output = process.stdout.isTTY && process.stdout.getColorDepth() >= 8
? colorText
: green(text)
: lightCyan(text)

console.log()
console.log(output)
Expand Down

0 comments on commit 1c6f0f7

Please sign in to comment.