color-conversions

Color conversion functions

Usage no npm install needed!

<script type="module">
  import colorConversions from 'https://cdn.skypack.dev/color-conversions';
</script>

README

color-conversions Build Status

Color conversion functions

Install

npm install --save color-conversions
component install andrepolischuk/color-conversions

Usage

var conversions = require('color-conversions');

conversions.hex2rgb('fff'); // [255, 255, 255]
conversions.hsl2cmyk(60, 100, 50, 0); // [0, 0, 100, 0]
conversions.keyword2hsv('red'); // [0, 100, 100]

API

Module has two-way conversion functions for color models:

  • RGB
  • Keyword
  • HEX
  • CMYK
  • HSL
  • HSV

License

MIT