In my application, I am trying to draw a gradientBackground from code. My goal is to make this background dynamic.
Now my question is: this function below is the function I'm talking about, and has a parameter int[] colors
GradientDrawable(GradientDrawable.Orientation orientation, int[] colors);
What values ββcan I put in the colors of int []? I know that the following value works.
But my problem is that I recalculate the hash values ββin my program, but they end as String, but it should end as an integer.
And it is not possible to convert a hash value, for example: String 0x34F323 to Int 0x34F323. When I recalculated the hash value and get:
String: #125BD7
And I use Integer.Decode ("# 125BD7"); The output will consist of seven numbers. But this does not work in the GradientDrawable method with the int [] parameter. Because all I get is a black background.
Can someone help me? What values ββcan I use in the GradientDrawable method?
source
share