add colors property in GradientColor
This commit is contained in:
parent
1c314bdb21
commit
bcc66b51b9
@ -604,6 +604,179 @@ class EffectsDemo extends Panel {
|
||||
],
|
||||
{ space: 20 }
|
||||
),
|
||||
hlayout(
|
||||
[
|
||||
vlayout(
|
||||
[
|
||||
label("Multi-Grad TOP_BOTTOM"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.TOP_BOTTOM
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
vlayout(
|
||||
[
|
||||
label("Gradient TR_BL"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.TR_BL
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
vlayout(
|
||||
[
|
||||
label("Multi-Grad RIGHT_LEFT"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.RIGHT_LEFT
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
vlayout(
|
||||
[
|
||||
label("Multi-Grad BR_TL"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.BR_TL
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
vlayout(
|
||||
[
|
||||
label("Multi-Grad BOTTOM_TOP"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.BOTTOM_TOP
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
vlayout(
|
||||
[
|
||||
label("Multi-Grad BL_TR"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.BL_TR
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
vlayout(
|
||||
[
|
||||
label("Gradient LEFT_RIGHT"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.LEFT_RIGHT
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
vlayout(
|
||||
[
|
||||
label("Multi-Grad TL_BR"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
orientation: GradientOrientation.TL_BR
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
],
|
||||
{ space: 20 }
|
||||
),
|
||||
],
|
||||
{
|
||||
space: 20
|
||||
|
5
doric-js/index.d.ts
vendored
5
doric-js/index.d.ts
vendored
@ -956,8 +956,9 @@ declare module 'doric/lib/src/util/color' {
|
||||
TL_BR = 7
|
||||
}
|
||||
export interface GradientColor {
|
||||
start: Color;
|
||||
end: Color;
|
||||
start?: Color;
|
||||
end?: Color;
|
||||
colors?: Array<Color>;
|
||||
orientation: GradientOrientation;
|
||||
}
|
||||
}
|
||||
|
5
doric-js/lib/src/util/color.d.ts
vendored
5
doric-js/lib/src/util/color.d.ts
vendored
@ -41,7 +41,8 @@ export declare enum GradientOrientation {
|
||||
TL_BR = 7
|
||||
}
|
||||
export interface GradientColor {
|
||||
start: Color;
|
||||
end: Color;
|
||||
start?: Color;
|
||||
end?: Color;
|
||||
colors?: Array<Color>;
|
||||
orientation: GradientOrientation;
|
||||
}
|
||||
|
@ -91,8 +91,9 @@ export enum GradientOrientation {
|
||||
}
|
||||
|
||||
export interface GradientColor {
|
||||
start: Color
|
||||
end: Color
|
||||
start?: Color
|
||||
end?: Color
|
||||
colors?: Array<Color>
|
||||
orientation: GradientOrientation
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user