Oval Gradient in Android

前端 未结 4 1208
礼貌的吻别
礼貌的吻别 2020-12-05 19:42

I know how to setup and display an oval shape. I know how to apply a gradient to this shape. What I cant figure out is how I can get an oval gradient to match the shape.

4条回答
  •  Happy的楠姐
    2020-12-05 20:20

    A "dumb but working" way to do this would be to draw your ellipse contour, then a multitude of nested ellipses with the same "center", whose sizes and colors change as the ellipses grow smaller, all the way to a one-pixel ellipse. If you custom code your gradient, interpolate the colors in HSV, not in RVB !

提交回复
热议问题