spaceship-sprites
Version:
Spaceship Sprite is a random ship sprite generator in typescript.
38 lines (37 loc) • 1.25 kB
TypeScript
declare class Color {
private _color;
constructor(r: number, g: number, b: number, a?: number);
copy(): Color;
equals(other: Color): boolean;
equalsAny(others: Array<Color>): boolean;
static random(randomAlpha?: boolean): Color;
get red(): number;
get green(): number;
get blue(): number;
get alpha(): number;
set red(value: number);
set green(value: number);
set blue(value: number);
set alpha(value: number);
get redByte(): number;
get greenByte(): number;
get blueByte(): number;
get alphaByte(): number;
toArray(): [number, number, number, number];
toByteArray(): [number, number, number, number];
toInt(): number;
toHexa(): string;
toRgb(): string;
toRgba(): string;
static fromInt(colorValue: number): Color;
static fromHexa(colorString: string): Color;
static withinPct(n: number): boolean;
static withinByte(n: number): boolean;
static toPct(n: number, valueName?: string): number;
mix(other: Color): Color;
mixWeighed(other: Color, w: number): Color;
static readonly BLACK: Color;
static readonly WHITE: Color;
static readonly TRANSPARENT: Color;
}
export default Color;