Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

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