Java Color Create toColor(byte[] bytes)

Here you can find the source of toColor(byte[] bytes)

Description

to Color

License

Open Source License

Declaration

public static Color toColor(byte[] bytes) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2013 Shuichi Miura./*from ww w . j  av  a2  s .  c om*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     Shuichi Miura - initial API and implementation
 ******************************************************************************/

import java.awt.Color;

public class Main {
    public static Color toColor(byte[] bytes) {

        return new Color((int) bytes[0], (int) bytes[1], (int) bytes[2], (int) bytes[3]);
    }
}

Related

  1. generatePallete(final int colours)
  2. generateRGBRandomColor()
  3. generateTexturePaint(String text, Font font, Color textColor, Color bgColor, int width, int height)
  4. generateVisuallyDistinctColors(int ncolors, float minComponent, float maxComponent)
  5. toColor(byte red, byte green, byte blue)
  6. toColor(final String hexColor)
  7. toColor(final String hexString)
  8. toColor(final String text, final Color defaultValue)
  9. toColor(float[] color)