如何获得位置的android渐变色?

如何获得位置的android渐变色?,android,gradient,Android,Gradient,我使用GradientDrawable,如下所示: line1.setBackground(new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, new int[]{fromColor, toColor})); 如何获得位置的渐变颜色(在[0,1]范围内),比如说0,8?位置的是什么意思?你的位置是什么意思?比如说“fromColor”的位置是0,“toColor”的位置是1.0你看到这个答案了吗?这看起来不像是对我问题的回

我使用GradientDrawable,如下所示:

line1.setBackground(new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, new int[]{fromColor, toColor}));

如何获得位置的渐变颜色(在[0,1]范围内),比如说0,8?

位置的
是什么意思?你的位置是什么意思?比如说“fromColor”的位置是0,“toColor”的位置是1.0你看到这个答案了吗?这看起来不像是对我问题的回答