NeoTechni Well-Known Member Licensed User Longtime User Nov 7, 2017 #1 When drawing a gradient in java, you can pass an array of floats to define the positions of the colors inside the gradient. In B4A, that's missing so they're all equidistant. How can I pass that array into a GradDrawable?
When drawing a gradient in java, you can pass an array of floats to define the positions of the colors inside the gradient. In B4A, that's missing so they're all equidistant. How can I pass that array into a GradDrawable?
stevel05 Expert Licensed User Longtime User Nov 7, 2017 #2 A sweep gradient allows defining positions : https://developer.android.com/reference/android/graphics/SweepGradient.html it is not immediately obvious how to apply it to a GradientDrawable. There is a setGradientType Method, but that just takes an integer. Edit: Looking further, it's probably not going to give the effect you're after. But I can't find any other options. Last edited: Nov 7, 2017 Upvote 0
A sweep gradient allows defining positions : https://developer.android.com/reference/android/graphics/SweepGradient.html it is not immediately obvious how to apply it to a GradientDrawable. There is a setGradientType Method, but that just takes an integer. Edit: Looking further, it's probably not going to give the effect you're after. But I can't find any other options.
stevel05 Expert Licensed User Longtime User Nov 7, 2017 #3 One possibility: https://stackoverflow.com/questions/4381033/multi-gradient-shapes Upvote 0