import { kanji2color, color2Kanji } from "kanji2color";
console.log(kanji2color("红色")); // "#FF0000"
console.log(kanji2color("你好")); // undefined
console.log(color2Kanji("#FF0000")); // [ '红色' ]
console.log(color2Kanji("#FF0000aa")); // undefined
仓库地址:
https://github.com/royalknight56/kanji2color
虽然代码不多,但是希望能帮助到别人
如果有需要的,或者缺失的颜色,可以提 pr 加