Configurable Color Transition Library – sweep.js

Category: Animation , Color , Javascript , Recommended | October 10, 2018
Views Total:403 views
Official Page:Go to website
Last Update:October 10, 2018


Configurable Color Transition Library – sweep.js


sweep.js is a vanilla JavaScript library which enables you to create smooth color transitions on any elements.

How to use it:

Insert the minified version of the sweep.js library into the html document.

<script src="bin/sweep.min.js"></script>

The basic JavaScript syntax.

sweep(target, properties, fromColor, toColor, options)
  • target: target element to animate
  • properties: CSS properties you wish to animate
  • fromColor: initial color
  • toColor: final color after the transition
  • options: an array of options

Available options.

  • callback: will be triggered once the animation finishes
  • direction: clockwise (1) or counterclockwise (-1)
  • duration: the duration of the animation.
  • space:  ‘HSL’, ‘HSLuv’, or ‘RGB’



  • Allow API to take an array of elements

You Might Be Interested In:

Leave a Reply