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

x/chalkpot_random_colors/mod.ts>similarColors

Random colors are tools for generating attractive color, similar colors, color palettes or any random colors.
Latest
function similarColors
import { similarColors } from "https://deno.land/x/chalkpot_random_colors@1.0.0/mod.ts";

Example

const someBlueColors = similarColors([0, 0, 255], { count: 2, deviation: 20 });
console.log(someBlueColors); // [[ 6.87..., 0, 252.68...], [ 0, 7.53..., 255 ]]

Parameters

color: Rgb

The source color from which a random similar color will be created.

optional
unnamed 1: { deviation?: number; count?: number; } = [UNSUPPORTED]

A color deviation is an RGB component in the numeric range 0 to 255, the range that will be added to the original color range.