import { Utils } from "../utils" ; export class Color { constructor ( public red , public green , public blue , public color ? ) { 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 ( ) { return this . red * 65536 + this . green * 256 + this . blue ; } }