Blend Colors Using Vanilla JavaScript – ColorBlend.js

Category: Color , Javascript | May 16, 2023
Authorjavierbyte
Last UpdateMay 16, 2023
LicenseMIT
Tags
Views177 views
Blend Colors Using Vanilla JavaScript – ColorBlend.js

ColorBlend.js is a tiny JavaScript library that provides a quick way to blend two colors programmatically.

It takes two color values in RGB format and returns the blended color between them at a specified intensity (0-1).

How to use it:

1. Download and import the ColorBlend.js.

<script src='index.js'></script>

2. Feed the ColorBlend.js with your two chosen colors and specify the intensity (0-1) as follows:

// var resultColor = colorBlend.overlay(firstColor, secondColor, intensity);
var resultColor = colorBlend.overlay([255,255,255], [0,0,0], .5);

You Might Be Interested In:


Leave a Reply