I am porting portals from iPhone to Android related to RGB colors.
Is I usually get my arguments using beta-level operations. You can wrap it in a supportive method which gives it as an array if it is more convenient. If you need a float, you can do something like If you are doing this many times (such as looping through a pixel in a bitmap), then you probably want to use the same array and pass it one Instead of turning on the new array, CGColorGetComponents in Android?
public int [] getColorComponents (int color) {int alpha = (color> & gt; 24) & amp; 0xff; Int red = (color> 16) & amp; 0xff; Int Green = (Color> 8) & amp; 0xff; Int Blue = Color & amp; 0xff; Return the new int [] {alpha, red, green, blue}; }
public float [] getColorComponents (int color) {int alpha = ( Color> & gt; 24) & amp; 0xff; Int red = (color> 16) & amp; 0xff; Int Green = (Color> 8) & amp; 0xff; Int Blue = Color & amp; 0xff; Float A = Float Alpha / 255; Float R = (float) red / 255; Float g = (float) green / 255; Float B = (float) blue / 255; New float return [] {a, r, g, b}; }
Comments
Post a Comment