Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/chalkpot_color/mod.ts>mixColors

Color is a tool for creating RGB color by range and by HSL without leaving RGB space.
Latest
function mixColors
import { mixColors } from "https://deno.land/x/chalkpot_color@3.1.0/mod.ts";

Example

const black = new Color(false, 0, 0, 0);
const white = new Color(false, 255, 255, 255);

const grey = mixColors(black, white, 50);
console.log(grey.components); // [127.5, 127.5, 127.5]

const _black = mixColors(black, white, 0);
console.log(_black.components); // [0, 0, 0]

const _white = mixColors(black, white, 100);
console.log(_white.components); // [255, 255, 255]

Parameters

first: Color
second: Color
percentage: number