colors.java

来自「一个俄罗斯方块的代码,对于j2me的初学者比较适合」· Java 代码 · 共 19 行

JAVA
19
字号
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 + -
显示快捷键?