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

x/chalkpot_color/color.ts>Color

Color is a tool for creating RGB color by range and by HSL without leaving RGB space.
Latest
class Color
import { Color } from "https://deno.land/x/chalkpot_color@3.1.0/color.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