Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar
Need To Find Work Or Die

Eleanor Carl treetrunkz

Need To Find Work Or Die
View GitHub Profile
treetrunkz / color.ts
Created August 21, 2020 05:18 — forked from EvAlex/color.ts
TypeScript Color class, useful to manipulate rgba components and convert to rga/rgba/hex
View color.ts
export const RGB_COLOR_REGEX = /\((\d+),\s*(\d+),\s*(\d+)(,\s*(\d*.\d*))?\)/;
export class Color {
public r: number;
public g: number;
public b: number;
public a: number;
constructor(colorStr?: string)