Android Paint和Color Neon Effect

时间:2014-06-04 04:46:58

标签: android paint

我有纯色RGB颜色,如下所示。如何将霓虹灯发光效果应用于下面的纯RGB颜色代码?我是编程的新手,所以请对此表示无知。

public static final class Color {
        static final float RGB_UPPER_BOUND = 255;
        static final float[] GRAY_RGB = {153/RGB_UPPER_BOUND, 60/RGB_UPPER_BOUND, 243/RGB_UPPER_BOUND};
        static final float[] WHITE_RGB = {255/RGB_UPPER_BOUND, 65/RGB_UPPER_BOUND, 5/RGB_UPPER_BOUND};
        static final float[] BLACK_RGB = {0/RGB_UPPER_BOUND, 0/RGB_UPPER_BOUND, 0/RGB_UPPER_BOUND};
        static final float[] RED_RGB = {255/RGB_UPPER_BOUND, 0/RGB_UPPER_BOUND, 0/RGB_UPPER_BOUND};
        static final float[] BLUE_RGB = {77/RGB_UPPER_BOUND, 77/RGB_UPPER_BOUND, 255/RGB_UPPER_BOUND};
        static final float[] GREEN_RGB = {131/RGB_UPPER_BOUND, 245/RGB_UPPER_BOUND, 44/RGB_UPPER_BOUND};

        public static final float[] WHITE = {
            WHITE_RGB[0],  WHITE_RGB[1],  WHITE_RGB[2],  1.0f,  // bottom left
            WHITE_RGB[0],  WHITE_RGB[1],  WHITE_RGB[2],  1.0f,  // top left
            WHITE_RGB[0],  WHITE_RGB[1],  WHITE_RGB[2],  1.0f,  // bottom right
            WHITE_RGB[0],  WHITE_RGB[1],  WHITE_RGB[2],  1.0f,  // top right
        };

        public static final float[] GRAY = {
            GRAY_RGB[0],  GRAY_RGB[1],  GRAY_RGB[2],  1.0f,
            GRAY_RGB[0],  GRAY_RGB[1],  GRAY_RGB[2],  1.0f,
            GRAY_RGB[0],  GRAY_RGB[1],  GRAY_RGB[2],  1.0f,
            GRAY_RGB[0],  GRAY_RGB[1],  GRAY_RGB[2],  1.0f,
        };

        public static final float[] BLUE = {
            BLUE_RGB[0],  BLUE_RGB[1],  BLUE_RGB[2],  1.0f,
            BLUE_RGB[0],  BLUE_RGB[1],  BLUE_RGB[2],  1.0f,
            BLUE_RGB[0],  BLUE_RGB[1],  BLUE_RGB[2],  1.0f,
            BLUE_RGB[0],  BLUE_RGB[1],  BLUE_RGB[2],  1.0f,
        };

        public static final float[] GREEN = {
            GREEN_RGB[0],  GREEN_RGB[1],  GREEN_RGB[2],  1.0f,
            GREEN_RGB[0],  GREEN_RGB[1],  GREEN_RGB[2],  1.0f,
            GREEN_RGB[0],  GREEN_RGB[1],  GREEN_RGB[2],  1.0f,
            GREEN_RGB[0],  GREEN_RGB[1],  GREEN_RGB[2],  1.0f,
        };

    }

更新

想要达到这样的效果,但霓虹灯不仅仅是霓虹色。 https://play.google.com/store/apps/details?id=com.ginnko.games.neonpong

0 个答案:

没有答案