interface IColor { toRgbString ( ) : string ; } class Color implements IColor { type { string } public memberOf public value : string ; type { number [ ] } public memberOf public rgb : [ number , number , number ] ; type { number } public memberOf public alpha : number ; type { number } public memberOf public positionInText : number ; param { string } value param { number } positionInText param { number } alpha param { number [ ] } rgb memberOf public constructor ( value , positionInText = 0 , rgb , alpha ? ) { this . value = value ; this . positionInText = positionInText ; this . alpha = alpha ?? 1 ; this . rgb = rgb ; } returns { string } public memberOf public toRgbString ( ) { return `rgb(${ this . rgb . join ( ', ' ) })` ; } returns { string } public memberOf public toRgbaString ( ) { return `rgba(${ this . rgb . join ( ', ' ) }, ${ this . alpha })` ; } } export default Color ; export { IColor } ;