Grade.js Produces Complimentary Gradients Generated from Dominant Image Colors

Datetime:2016-08-22 23:02:50          Topic: JavaScript           Share

Grade.js

This JavaScript library produces complimentary gradients generated from the top 2 dominant colours in supplied images.

Download

GitHub npm

npm install grade-js

Usage

<!--the gradient is applied to this div as a background-image-->
<div class="gradient-wrap">
    <!--this inner image is used to create the gradient-->
    <img src="./samples/good-dinosaur.jpg" />
</div>

<script src="../dist/grade.js"></script>
<script type="text/javascript">
    window.addEventListener('load', function(){
        Grade(document.querySelectorAll('.gradient-wrap'))
    })
</script>




About List