import { Component } from "@angular/core" ; import { OrangeRed , isKnownName } from "@nativescript/core/color/known-colors" ; import { Color } from "@nativescript/core" ; @ Component ( { moduleId : module . id , templateUrl : "./usage.component.html" } ) export class UsageComponent { createColor ( ) { let colorHex = new Color ( "#FF00CC" ) ; let colorShortHex = new Color ( "#F0C" ) ; let colorARGB = new Color ( 100 , 255 , 100 , 100 ) ; let argb = ( 100 << 24 ) | ( 100 << 16 ) | ( 100 << 8 ) | 100 ; let colorSingleARGB = new Color ( argb ) ; let namedColor = "orangered" ; let isKnown = isKnownName ( namedColor ) ; if ( isKnown ) { let colorName = new Color ( namedColor ) ; } let colorKnownName = new Color ( OrangeRed ) ; } }