ShapeDrawable.ShaderFactory sf = new ShapeDrawable.ShaderFactory() {
@Override
public Shader resize(int width, int height) {
LinearGradient lg = new LinearGradient(0, 0, 0, border.getHeight(),
new int[] {
Color.CYAN,
Color.WHITE,
Color.WHITE
}, //substitute the correct colors for these
new float[] {
0, 0.45f, 0.55f, 1 },
Shader.TileMode.REPEAT);
return lg;
}
}
In this code instead of using Color.CYAN I want to insert a hexadecimal value for the color. Any suggestions?
1 Answer