angular-material-components
angular-material-components copied to clipboard
toRgbString doesn't show correct alpha value
The function toRgbString of class Color doesn't show correct alpha value. The function return a string like rgb(r,g,b) or rgba(r,g,b,1).
public toRgbString(): string {
return (this.a === 1) ?
"rgb(" + Math.round(this.r) + ", " + Math.round(this.g) + ", " + Math.round(this.b) + ")" :
"rgba(" + Math.round(this.r) + ", " + Math.round(this.g) + ", " + Math.round(this.b) + ", " + this.roundA + ")";
}
Is possible that "this.roundA" has to be changed with "this.a"?
public toRgbString(): string {
return (this.a === 1) ?
"rgb(" + Math.round(this.r) + ", " + Math.round(this.g) + ", " + Math.round(this.b) + ")" :
"rgba(" + Math.round(this.r) + ", " + Math.round(this.g) + ", " + Math.round(this.b) + ", " + this.a + ")";
}
I face the same problem: for example, alpha 0.26 is shown 0
On screen: alpha .54 is shown 1