UNPKG

@obliczeniowo/elementary

Version:
51 lines (50 loc) 1.63 kB
export declare class ColorRGB { private r; private g; private b; protected a: number; /** * Calculate color with linear interpolation using factor parameter */ static proportionalColor(firstColor: ColorRGB, secondColor: ColorRGB, factor: number): ColorRGB; static fromHex(hexColor: string): ColorRGB; static fromHtmlColor(htmlColor: string): ColorRGB; constructor(red: number | string, green: number | string, blue: number | string, alpha?: number | string); private getHex; /** set red value of color with handling min/max */ set red(red: number); get red(): number; /** set green value of color with handling min/max */ set green(green: number); get green(): number; /** set blue value of color with handling min/max */ set blue(blue: number); get blue(): number; get alpha(): number; /** set alpha value of color with handling min/max */ set alpha(alpha: number); /** * Return color in hex format including transparency * @return - format #ffccbbaa (last one is alpha) */ get getHexColor(): string; /** * Return hex format of color without alpha * @return color in format: #ff00bb */ get getHexColorBase(): string; /** * Return rgba(100, 200, 255, 0.5) color format as string */ getRGBAColor(): string; toString(): string; /** * create object copy */ copy(): ColorRGB; /** * Multiply every single value of colors by factor parameter with handling min/max cases */ multiply(factor: number): ColorRGB; negative(): ColorRGB; }