js: add locations in gradient color
This commit is contained in:
parent
c2264e621c
commit
e26a2f3256
@ -777,6 +777,33 @@ class EffectsDemo extends Panel {
|
||||
],
|
||||
{ space: 20 }
|
||||
),
|
||||
hlayout(
|
||||
[
|
||||
vlayout(
|
||||
[
|
||||
label("Multi-Grad locations"),
|
||||
box().apply({
|
||||
width: 100,
|
||||
height: 100,
|
||||
backgroundColor: {
|
||||
colors: [colors[0], Color.WHITE, colors[1]],
|
||||
locations: [0, 0.3, 1],
|
||||
orientation: GradientOrientation.TOP_BOTTOM
|
||||
},
|
||||
layoutConfig: layoutConfig().just().configMargin({
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
gravity: Gravity.Center,
|
||||
space: 10,
|
||||
}),
|
||||
],
|
||||
{ space: 20}
|
||||
)
|
||||
],
|
||||
{
|
||||
space: 20
|
||||
|
1
doric-js/index.d.ts
vendored
1
doric-js/index.d.ts
vendored
@ -959,6 +959,7 @@ declare module 'doric/lib/src/util/color' {
|
||||
start?: Color;
|
||||
end?: Color;
|
||||
colors?: Array<Color>;
|
||||
locations?: Array<Number>;
|
||||
orientation: GradientOrientation;
|
||||
}
|
||||
}
|
||||
|
1
doric-js/lib/src/util/color.d.ts
vendored
1
doric-js/lib/src/util/color.d.ts
vendored
@ -44,5 +44,6 @@ export interface GradientColor {
|
||||
start?: Color;
|
||||
end?: Color;
|
||||
colors?: Array<Color>;
|
||||
locations?: Array<Number>;
|
||||
orientation: GradientOrientation;
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ export interface GradientColor {
|
||||
start?: Color
|
||||
end?: Color
|
||||
colors?: Array<Color>
|
||||
locations?: Array<Number>
|
||||
orientation: GradientOrientation
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user