import { transSketchColor } from '../../common/utils' ; import { SKLayer , Background } from '../../types' ; export default ( layer ) : Background => { let { alpha , red , green , blue } = layer . backgroundColor || { } ; if ( layer . style ?. contextSettings ) { alpha = layer . style . contextSettings . opacity * alpha ; } if ( alpha > 0 ) { return { color : transSketchColor ( { red , green , blue , alpha } ) , } ; } return { } ; } ;