[Ionic 4] Get primary color from code

How to get the Primary color in variables.css from code? [Ionic 4]

this one: --ion-color-primary: #008c8c;

i want to get this on typescript…

Thanksss

To get Sass variable from TypeScript code I use this javascript code.

getComputedStyle(document.documentElement).getPropertyValue('--ion-color-secondary')

Example

const my_statusbar_color = getComputedStyle(document.documentElement).getPropertyValue('--ion-color-secondary');
StatusBar.setBackgroundColor({ color: my_statusbar_color })
StatusBar.show();

I hope I’ve helped