From c7dc09464b28518c2ae383fa16b989e7c0169599 Mon Sep 17 00:00:00 2001 From: inhere Date: Sun, 17 Oct 2021 23:50:02 +0800 Subject: [PATCH] sytle: update readme --- README.md | 7 +++---- README.zh-CN.md | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f39b5ce..9e562d7 100644 --- a/README.md +++ b/README.md @@ -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 `message`. - In addition to using built-in tags, it also supports custom color attributes @@ -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 diff --git a/README.zh-CN.md b/README.zh-CN.md index 4bb22b4..0fe7d4a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -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 message` 标签内部的文本将会渲染为绿色字体 @@ -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` + ## 方法参考 一些有用的工具方法参考