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 final int TRANSPARENT = 0;

    /**
     * Returns a darker version of the specified color. Returns a translucent gray for transparent colors.
     */
    private static int darkenColor(int color) {
        if (color == TRANSPARENT) {
            return Color.argb(127, 127, 127, 127);
        }
        return Color.rgb(Color.red(color) * 192 / 256, Color.green(color) * 192 / 256,
                Color.blue(color) * 192 / 256);
    }
}