Java tutorial
//package com.java2s; import android.graphics.Color; public class Main { public static int borderColorForBackground(int color) { return Color.rgb(Math.max(0, Color.red(color) - 30), Math.max(0, Color.green(color) - 30), Math.max(0, Color.blue(color) - 30)); } }