colors.java

来自「J2ME 开发的俄罗斯方块手机游戏源码。」· Java 代码 · 共 33 行

JAVA
33
字号
/*
 * Created on 2005-5-26
 * Author: Liao Xuefeng, asklxf@163.com
 * Copyright (C) 2005, Liao Xuefeng.
 */

/**
 * TODO Description here...
 * 
 * @author Xuefeng
 */
public final class Colors {

    public static final int[] ALL_COLORS = {
            0xff0000, 0xffff00, 0xff00ff,
            0x00ff00, 0x00ffff,
            0x0000ff,
            0xffffff,
            0xaa0000, 0xaaaa00, 0xaa00aa,
            0x00aa00, 0x00aaaa,
            0x0000aa,
            0xaaaaaa
    };

    public static int indexOfColor(int color) {
        for(int i=0; i<ALL_COLORS.length; i++) {
            if(ALL_COLORS[i]==color) return i;
        }
        return 0;
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?