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

x/chalkpot_color/component_effects/alpha_component.ts>alphaComponent

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

Example

const firstColor = alphaColor([255, 0, 0], true, 90);
console.log(firstColor); // [255, 0, 0, 90];

const secondColor = alphaColor([0, 255, 0], true);
console.log(secondColor); // [0, 255, 0, 100];

const thirdColor = alphaColor(secondColor, false);
console.log(thirdColor); // [0, 255, 0];

Parameters

components: Rgb | Rgba
alpha: boolean
optional
percentage = [UNSUPPORTED]