Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.graphics.Color;

public class Main {
    /**
     * @return luma value according to to YIQ color space.
     */
    public static final int calculateYiqLuma(int color) {
        return Math.round((299 * Color.red(color) + 587 * Color.green(color) + 114 * Color.green(color)) / 1000f);
    }
}