Skip to content

Instantly share code, notes, and snippets.

@omegasoft7
Created December 10, 2014 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omegasoft7/1fce35d16ad24d72687f to your computer and use it in GitHub Desktop.
Save omegasoft7/1fce35d16ad24d72687f to your computer and use it in GitHub Desktop.
public static int colorFromIOS(double r, double g, double b, double a) {
int red = (int) (r * 255);
int green = (int) (g * 255);
int blue = (int) (b * 255);
int alpha = (int) (a * 255);
return Color.argb(alpha, red, green, blue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment