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[];
|
colors: ColorStop[];
|
||||||
}
|
}
|
||||||
export interface Background {
|
export interface Background {
|
||||||
readonly color?: number;
|
readonly color?: number | Color;
|
||||||
readonly image?: URL | LinearGradient;
|
readonly image?: URL | LinearGradient;
|
||||||
readonly repeat?: BackgroundRepeat;
|
readonly repeat?: BackgroundRepeat;
|
||||||
readonly position?: BackgroundPosition;
|
readonly position?: BackgroundPosition;
|
||||||
|
|||||||
@@ -838,7 +838,10 @@ backgroundPositionProperty.register(Style);
|
|||||||
function convertToBackgrounds(this: void, value: string): [CssProperty<any, any>, any][] {
|
function convertToBackgrounds(this: void, value: string): [CssProperty<any, any>, any][] {
|
||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
const backgrounds = parser.parseBackground(value).value;
|
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;
|
let backgroundImage: string | LinearGradient;
|
||||||
if (typeof backgrounds.image === 'object' && backgrounds.image) {
|
if (typeof backgrounds.image === 'object' && backgrounds.image) {
|
||||||
|
|||||||
Reference in New Issue
Block a user