From 56e2a89fb8482e69251457ac0d412e0772e3ccba Mon Sep 17 00:00:00 2001 From: Victor Bo <10667379@qq.com> Date: Sun, 29 Jan 2023 11:40:01 +0800 Subject: [PATCH] chore: fix docs error --- docs/method/color.md | 32 ++++++++++++++++++++++++++++---- docs/method/string.md | 4 ++-- packages/color/index.ts | 14 ++++++++++++++ packages/color/rgbaToHex.ts | 2 +- 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/docs/method/color.md b/docs/method/color.md index 78ef181..ff2a67c 100644 --- a/docs/method/color.md +++ b/docs/method/color.md @@ -1,5 +1,32 @@ # Color 函数库 +## colorDarken + +```ts +/** + * @description 加深颜色 + * + * @function colorDarken + * @param { string | number[] } color - 16进制颜色 | RGBA颜色 + * @param { number } level - 加深权重 0 - 10 0 自身 10 黑色 + * @returns { string | number[] } - HEX | [R, G, B, A] + */ +``` + +## colorLighten + +```ts +/** + * @description 变浅颜色 + * + * @function colorLighten + * @param { string | number[] } color - 16进制颜色 | RGBA颜色 + * @param { number } level - 加深权重 = 0 0 - 10 0 自身 10 白色 + * @param { 'HEX' | 'RGBA' } type - 返回类型 = 'HEX' + * @returns { string | number[] } - HEX | [R, G, B, A] + */ +``` + ## hexToRgba ```ts @@ -30,10 +57,7 @@ * @description RGBA 转 HEX * * @function rgbaToHex - * @param { number } r (0 - 255) - 红 - * @param { number } g (0 - 255) - 绿 - * @param { number } b (0 - 255) - 蓝 - * @param { number } [a] (0 - 1) - 透明度 + * @param { number[] } rgba - RGBA颜色 * @returns { string } - 16进制颜色 */ ``` diff --git a/docs/method/string.md b/docs/method/string.md index 0b485f7..c9d8428 100644 --- a/docs/method/string.md +++ b/docs/method/string.md @@ -20,7 +20,7 @@ * * @function decrypt * @param { string } data - 欲解密数据 - * @param { string } salt - 盐 + * @param { string } source - 字符库 * @returns { string } - 解密数据 */ ``` @@ -33,7 +33,7 @@ * * @function encrypt * @param { string } data - 欲加密数据 - * @param { string } salt - 盐 + * @param { string } source - 字符库 * @returns { string } - 加密数据 */ ``` diff --git a/packages/color/index.ts b/packages/color/index.ts index 17cec05..9422d4c 100644 --- a/packages/color/index.ts +++ b/packages/color/index.ts @@ -1,6 +1,14 @@ // 此文件为自动生成的导出文件 // 请务必不要在此文件进行修改或其他操作 // 因为你做的所有修改和操作都不会生效 +import { + colorDarken, +} from './colorDarken' + +import { + colorLighten, +} from './colorLighten' + import { hexToRgba, } from './hexToRgba' @@ -39,6 +47,8 @@ import { export const resolveColorUtils = (aliasPrefix?: string): Record => { return { '@vtrbo/utils/color': [ + ['colorDarken', aliasPrefix ? `${aliasPrefix}ColorDarken` : 'colorDarken'], + ['colorLighten', aliasPrefix ? `${aliasPrefix}ColorLighten` : 'colorLighten'], ['hexToRgba', aliasPrefix ? `${aliasPrefix}HexToRgba` : 'hexToRgba'], ['randomHex', aliasPrefix ? `${aliasPrefix}RandomHex` : 'randomHex'], ['rgbaToHex', aliasPrefix ? `${aliasPrefix}RgbaToHex` : 'rgbaToHex'], @@ -47,12 +57,16 @@ export const resolveColorUtils = (aliasPrefix?: string): Record {