Java tutorial
//package com.java2s; import org.json.JSONException; import org.json.JSONObject; import android.graphics.Color; public class Main { public static int getIntFromRGB(JSONObject rgb) { int color = 0; try { color = Color.rgb(rgb.getInt("red"), rgb.getInt("green"), rgb.getInt("blue")); } catch (JSONException e) { e.printStackTrace(); } return color; } }