import handleLinearGradient from './handleLinearGradient' ; import handleRadialGradient from './handleRadialGradient' ; import { SKLayer , SKFillItem , Background } from '../../../../types' ; export default ( fillStyle , layer ) : Background => { if ( ! fillStyle . gradient ) { return { } ; } let gradient = fillStyle . gradient ; let contextSettings = fillStyle . contextSettings ? fillStyle . contextSettings . opacity : 1 ; let gradientType = gradient . gradientType ; if ( gradientType === 0 ) { return { linearGradient : handleLinearGradient ( gradient , layer , contextSettings ) } ; } if ( gradientType === 1 ) { return { radialGradient : handleRadialGradient ( gradient , layer , fillStyle , contextSettings ) } ; } if ( gradientType === 2 ) { return { } ; } } ;