You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 875d1a3
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# Changelog
2
2
3
+
## 3.19.0
4
+
5
+
### New
6
+
7
+
-**`Image.linearGradient(width, height, { stops, angle })`** and **`Image.radialGradient(width, height, { stops, x, y, radius })`**: images with a gradient, with the angle like CSS' `linear-gradient()`. `stops` are positions and colors like `Colors.gradient()` takes them, or just the colors, evenly spaced.
assert(px(defaultDirection,0,0).join()===px(defaultDirection,1,0).join()&&px(defaultDirection,0,0)[0]>px(defaultDirection,0,2)[0],'linearGradient goes down by default');
assert(px(diagonal,0,0)[0]<20&&px(diagonal,7,7)[0]>235&&px(diagonal,7,0).join()===px(diagonal,0,7).join(),'linearGradient at 135deg runs from corner to corner');
645
+
// (an array of colors is evenly spaced, one color is a plain fill, alpha is part of the color)
646
+
assert(px(Image.linearGradient(3,1,{stops: [0xff0000ff,0x00ff00ff,0x0000ffff],angle: 90}),1,0).join()===rgba(ColorHelpers.gradient({0: 0xff0000ff,0.5: 0x00ff00ff,1: 0x0000ffff})(0.5)).join(),'linearGradient with an array of colors');
647
+
assert(px(Image.linearGradient(3,3,{stops: [0x336699ff]}),2,2).join()==='51,102,153,255','linearGradient with one color');
assert(px(radial,4,4)[0]>240&&px(radial,0,0)[0]<40&&px(radial,0,8).join()===px(radial,8,0).join(),'radialGradient from the center to the farthest corner');
0 commit comments