Android Color Lighter isColourLight(int colour)

Here you can find the source of isColourLight(int colour)

Description

is Colour Light

License

Open Source License

Declaration

public static boolean isColourLight(int colour) 

Method Source Code

//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;
    }
}

Related

  1. getLighter(int colour)