Java Integer to intToRGB(int color)

Here you can find the source of intToRGB(int color)

Description

int To RGB

License

Open Source License

Declaration

public static float[] intToRGB(int color) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static float[] intToRGB(int color) {
        float[] rgb = new float[3];
        long blue = color % 256;
        color = color / 256;//  ww  w.java 2 s.  c om
        long green = color % 256;
        color = color / 256;
        long red = color % 256;

        rgb[0] = red / 255F;
        rgb[1] = green / 255F;
        rgb[2] = blue / 255F;

        return rgb;
    }
}

Related

  1. intToPaddedString(int value, int pad)
  2. intToPercent(int value)
  3. intToPlusMin(int i)
  4. intToPrefixCoded(final int val, final int shift, final char[] buffer)
  5. intToRegisters(int v)
  6. IntToRGB(int rgbInt)
  7. intToRgbComponents(int rgb)
  8. intToRoman(int i)
  9. intToRoman(int value)