phi-colors
phi-colors is a library that generates phi ratio colors that like this for JavaScript/TypeScript.
How to use
const phiColors = phiColors; console; // 1.618033988749895const rgba = phiColors; // {"r":1,"g":0.8,"b":0.5333333333333333,"a":0.26666666666666666}const hsla = phiColors; // {"h":0.6058911188392467,"s":0.27034500134658757,"l":0.7777777777777778,"a":0.26666666666666666}const newColors = ;forlet i = 0; i < 7; ++i const generatedHsla = phiColorsgenerate hsla // base color i // hue arrange index 00 // saturation arrange index 00 // lightness arrange index 00 // alpha arrange index ; const generatedRgba = phiColors; const generatedStyle = phiColors; newColors;console; // ["#FFCC8844","#EAE1FF44","#97FE9644","#FFC7D944","#B5E0FF44","#D6E57644",
How to build
requires: Node.js, TypeScript Compiler
tsc -P .
or tsc -P . -w
In VS Code
You can use automatic build. Run Tasks: Allow Automatic Tasks in Folder
command from command palette ( Mac: F1 or Shift+Command+P, Windows and Linux: F1 or Shift+Ctrl+P), and restart VS Code.