import { BuildableTree , Snippet } from "../builder/buildable-tree" ; import { defaultParam } from "../decorations/params" ; /**
 * https://api.flutter.dev/flutter/dart-ui/Color-class.html
 */ export class Color extends BuildableTree { @ defaultParam ( ) value : Snippet | number ; constructor ( value ? ) { super ( ) ; if ( value ) { this . value = Snippet . fromStatic < Snippet > ( "0x" + value ?. toString ( 16 ) ) ; } else { throw "the value:number provided must be a valid color value" ; } } static fromHex ( hex ) { try { hex = hex . replace ( '#' , '' ) ; return new Color ( parseInt ( hex , 16 ) ) ; } catch ( e ) { return undefined ; } } static fromRGBO ( r , g , b , o ) { throw "not implemented" ; } }