Add support for alpha in legend
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2020-09-16 14:40:03 +02:00
parent 3008081ae8
commit 394bbab320
4 changed files with 7 additions and 2 deletions

View File

@@ -53,6 +53,10 @@ export class LegendComponent implements OnInit,AfterViewInit {
return '#' + this.componentToHex(color.red) + this.componentToHex(color.green) + this.componentToHex(color.blue);
}
public getAlphaHex(color: IColor): string {
return '#' + this.componentToHex(color.red) + this.componentToHex(color.green) + this.componentToHex(color.blue)+ this.componentToHex(color.alpha);
}
private componentToHex(c: number): string {
const hex = c.toString(16);
return hex.length === 1 ? `0${hex}` : hex;