Files
NapCatQQ/.pnpm-store/v3/files/6c/7b5b326f195176a7116e0bdb96f17abfbbd9de2c09f56664014b63e0e28843ae9c5405ade0053be7e6fa859190d31f6b72be136dfa44d59a698a9a5354cac6
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

47 lines
1.2 KiB
Plaintext

Based on Arnout Kazemier's https://github.com/3rd-Eden/colorspace, only difference is updated packages to remove security vulnerbilities.
All credit goes to him.
# colorspace
Colorspace is a simple module which generates HEX color codes for namespaces.
The base color is decided by the first part of the namespace. All other parts of
the namespace alters the color tone. This way you can visually see which
namespaces belong together and which does not.
## Installation
The module is released in the public npm registry and can be installed by
running:
```
npm install --save @so-ric/colorspace
```
## Usage
We assume that you've already required the module using the following code:
```js
'use strict';
var colorspace = require('@so-ric/colorspace');
```
The returned function accepts 2 arguments:
1. `namespace` **string**, The namespace that needs to have a HEX color
generated.
2. `delimiter`, **string**, **optional**, Delimiter to find the different
sections of the namespace. Defaults to `:`
#### Example
```js
console.log(colorspace('color')) // #6b4b3a
console.log(colorspace('color:space')) // #796B67
```
## License
MIT