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

x/chalkpot_random_colors/deps.ts>Color

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

Color contains the components, red, green, blue.

Example

const red = new Color(false, 255, 0, 0)
const blue = new Color(true, 0, 0, 100);

Percentage. Use percentages instead of component range, if true.

Constructors

new
Color(percentage?: boolean, ...components: Rgb)

Properties

readonly
blue: number
readonly
components: Rgb
readonly
green: number
readonly
red: number

Methods

private
rgbPercent(...components: Rgb): Rgb