@andrew-codes/color-functions

Collection of functions to manipulate colors in JavaScript

Usage no npm install needed!

<script type="module">
  import andrewCodesColorFunctions from 'https://cdn.skypack.dev/@andrew-codes/color-functions';
</script>

README

Build Status

@andrew-codes/color-functions

A variety of color manipulation functions written in JavaScript.

Install

npm install @andrew-codes/color-functions

Exposed Functions

  • clamp : numeric
  • desaturate
  • saturate
  • lighten
  • darken
  • tint
  • shade
  • setOpacity
  • getContrastRatio
  • getLuminance
  • toHex : string
  • toHexString: string
  • toHsla : hsla color object
  • toHslaString: string
  • toRgba : rbga color object
  • toRgbaString: string