@@ -16,23 +16,23 @@ export class ColorsComponent implements OnInit, AfterViewInit {
16
16
17
17
public themeColors ( ) : void {
18
18
Array . from ( this . document . querySelectorAll ( '.theme-color' ) ) . forEach (
19
- // @ts -ignore
20
- ( el : HTMLElement ) => {
21
- const background = getStyle ( 'background-color' , el ) ;
19
+ ( element : Element ) => {
20
+ const htmlElement = element as HTMLElement ;
21
+ const background = getStyle ( 'background-color' , htmlElement ) ?? '#fff' ;
22
22
const table = this . renderer . createElement ( 'table' ) ;
23
23
table . innerHTML = `
24
- <table class=' table w-100' >
24
+ <table class=" table w-100" >
25
25
<tr>
26
- <td class=' text-muted' >HEX:</td>
27
- <td class=' font-weight-bold' >${ rgbToHex ( background ) } </td>
26
+ <td class=" text-muted" >HEX:</td>
27
+ <td class=" font-weight-bold" >${ rgbToHex ( background ) } </td>
28
28
</tr>
29
29
<tr>
30
- <td class=' text-muted' >RGB:</td>
31
- <td class=' font-weight-bold' >${ background } </td>
30
+ <td class=" text-muted" >RGB:</td>
31
+ <td class=" font-weight-bold" >${ background } </td>
32
32
</tr>
33
33
</table>
34
34
` ;
35
- this . renderer . appendChild ( el . parentNode , table ) ;
35
+ this . renderer . appendChild ( htmlElement . parentNode , table ) ;
36
36
// @ts -ignore
37
37
// el.parentNode.appendChild(table);
38
38
}
@@ -49,8 +49,8 @@ export class ColorsComponent implements OnInit, AfterViewInit {
49
49
@Component ( {
50
50
selector : 'app-theme-color' ,
51
51
template : `
52
- <c-col xl='2' md='4' sm='6' xs='12' class=' my-4 ms-4' >
53
- <div [ngClass]=' colorClasses' style=' padding-top: 75%;' ></div>
52
+ <c-col xl="2" md="4" sm="6" xs="12" class=" my-4 ms-4" >
53
+ <div [ngClass]=" colorClasses" style=" padding-top: 75%;" ></div>
54
54
<ng-content></ng-content>
55
55
</c-col>
56
56
`
0 commit comments