Here you can find the source of toColors(boolean hasAlpha, int... colors)
Parameter | Description |
---|---|
hasAlpha | true to consider the alpha when creating the Color. |
colors | the color value. |
public static Color[] toColors(boolean hasAlpha, int... colors)
//package com.java2s; import java.awt.*; public class Main { /**//from w w w .j a v a 2 s . co m * Simply calls new Color(color, hasalpha) for each color in colors and returns all of them. * * @param hasAlpha true to consider the alpha when creating the Color. * @param colors the color value. * * @return the colors with alpha added. */ public static Color[] toColors(boolean hasAlpha, int... colors) { Color[] result = new Color[colors.length]; for (int i = 0; i < colors.length; i++) { result[i] = new Color(colors[i], hasAlpha); } return result; } }