mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
@@ -23,7 +23,7 @@ export interface LinearGradient {
|
||||
colors: ColorStop[];
|
||||
}
|
||||
export interface Background {
|
||||
readonly color?: number;
|
||||
readonly color?: number | Color;
|
||||
readonly image?: URL | LinearGradient;
|
||||
readonly repeat?: BackgroundRepeat;
|
||||
readonly position?: BackgroundPosition;
|
||||
|
||||
@@ -838,7 +838,10 @@ backgroundPositionProperty.register(Style);
|
||||
function convertToBackgrounds(this: void, value: string): [CssProperty<any, any>, any][] {
|
||||
if (typeof value === 'string') {
|
||||
const backgrounds = parser.parseBackground(value).value;
|
||||
const backgroundColor = backgrounds.color ? new Color(backgrounds.color) : unsetValue;
|
||||
let backgroundColor = unsetValue;
|
||||
if (backgrounds.color) {
|
||||
backgroundColor = backgrounds.color instanceof Color ? backgrounds.color : new Color(backgrounds.color);
|
||||
}
|
||||
|
||||
let backgroundImage: string | LinearGradient;
|
||||
if (typeof backgrounds.image === 'object' && backgrounds.image) {
|
||||
|
||||
Reference in New Issue
Block a user