Here you can find the source of isColourLight(int colour)
public static boolean isColourLight(int colour)
//package com.java2s; //License from project: Open Source License import android.graphics.Color; public class Main { public static boolean isColourLight(int colour) { if (colour == 0) { return false; }/*from ww w . j av a2 s . c om*/ int red = Color.red(colour); int blue = Color.blue(colour); int green = Color.green(colour); return (int) Math.sqrt(red * red * .241 + green * green * .691 + blue * blue * .068) > 130; } }