Java Color Create toColor(float[] color)

Here you can find the source of toColor(float[] color)

Description

to Color

License

Apache License

Declaration

public static Color toColor(float[] color) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.Color;

public class Main {
    public static Color toColor(float[] color) {
        if (color.length == 4)
            return new Color(color[0], color[1], color[2], color[3]);
        else/*from   w w  w.j  a va2 s  . c om*/
            return new Color(color[0], color[1], color[2], 1);
    }
}

Related

  1. toColor(byte red, byte green, byte blue)
  2. toColor(byte[] bytes)
  3. toColor(final String hexColor)
  4. toColor(final String hexString)
  5. toColor(final String text, final Color defaultValue)
  6. toColor(int rgba)
  7. toColor(int x)
  8. toColor(Node n)
  9. toColor(short rgb565)