Skip to content

Commit

Permalink
sytle: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Oct 17, 2021
1 parent 3986cfd commit c7dc094
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Now, 256 colors and RGB colors have also been supported to work in Windows CMD a
- 16-color output is the most commonly used and most widely supported, working on any Windows version
- Since `v1.2.4` **the 256-color (8-bit), true color (24-bit) support windows CMD and PowerShell**
- See [this gist](https://gist.github.com/XVilka/8346728) for information on true color support
- Support converts `HEX` `HSL` value to RGB color
- Generic API methods: `Print`, `Printf`, `Println`, `Sprint`, `Sprintf`
- Supports HTML tag-style color rendering, such as `<green>message</>`.
- In addition to using built-in tags, it also supports custom color attributes
Expand Down Expand Up @@ -417,14 +418,12 @@ rgb.Println("rgb color")
rgb.C256().Println("256 color")
```

**More converts functions**:

convert to rgb:
**More functions for convert to `RGBColor`**:

- `func RGBFromSlice(rgb []uint8, isBg ...bool) RGBColor`
- `func RGBFromString(rgb string, isBg ...bool) RGBColor`
- `func HEX(hex string, isBg ...bool) RGBColor`
- `func HSL(h, s, l float32, isBg ...bool) RGBColor`
- `func HSL(h, s, l float64, isBg ...bool) RGBColor`
- `func HSLInt(h, s, l int, isBg ...bool) RGBColor`

## Func refer
Expand Down
9 changes: 9 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Golang下的命令行色彩使用库, 拥有丰富的色彩渲染输出,通用
- 16色(4bit)是最常用和支持最广的,支持Windows `cmd.exe`
-`v1.2.4`**256色(8bit),RGB色彩(24bit)均支持Windows CMD和PowerShell终端**
- 请查看 [this gist](https://gist.github.com/XVilka/8346728) 了解支持RGB色彩的终端
- 支持转换 `HEX` `HSL` 等为RGB色彩
- 提供通用的API方法:`Print` `Printf` `Println` `Sprint` `Sprintf`
- 同时支持html标签式的颜色渲染,除了使用内置标签,同时支持自定义颜色属性
- 例如: `this an <green>message</>` 标签内部的文本将会渲染为绿色字体
Expand Down Expand Up @@ -421,6 +422,14 @@ rgb.Println("rgb color")
rgb.C256().Println("256 color")
```

**更多转换方法转换为 `RGBColor`**:

- `func RGBFromSlice(rgb []uint8, isBg ...bool) RGBColor`
- `func RGBFromString(rgb string, isBg ...bool) RGBColor`
- `func HEX(hex string, isBg ...bool) RGBColor`
- `func HSL(h, s, l float64, isBg ...bool) RGBColor`
- `func HSLInt(h, s, l int, isBg ...bool) RGBColor`

## 方法参考

一些有用的工具方法参考
Expand Down

0 comments on commit c7dc094

Please sign in to comment.