Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1x 1x 9x 9x 2x 2x 2x 2x 1x 7x 1x | import { Utils } from "../utils";
export class Color {
constructor(public red: number, public green: number, public blue: number, public color?: string) {
if (color) {
this.color = color.toUpperCase();
this.red = Utils.hexToNumber(color.substr(0, 2));
this.green = Utils.hexToNumber(color.substr(2, 2));
this.blue = Utils.hexToNumber(color.substr(4, 2));
}
}
public getValue() {
// tslint:disable-next-line:no-bitwise
return this.red * 65536 + this.green * 256 + this.blue;
}
} |