According to what I\'ve read, you can use a gradientDrawable and have three colors set for it, for example:
Using GradientDrawble we can achieve this
GradientDrawable gradientInsta = new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT,
new int[] {
Color.parseColor("#F9ED32"),
Color.parseColor("#F6C83F"),
Color.parseColor("#F2735F"),
Color.parseColor("#EF3E73"),
Color.parseColor("#EE2A7B"),
Color.parseColor("#D22A8A"),
Color.parseColor("#8B2AB1"),
Color.parseColor("#1C2AEF"),
Color.parseColor("#002AFF”),
ContextCompat.getColor(MainActivity.this, R.color.colorPrimary)
});
findViewById(R.id.insta).setBackground(gradientInsta);