Java Color Create generateColorModel()

Here you can find the source of generateColorModel()

Description

generate Color Model

License

Open Source License

Declaration

public static ColorModel generateColorModel() 

Method Source Code


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

import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;

public class Main {
    public static ColorModel generateColorModel() {
        byte[] r = new byte[255];
        byte[] g = new byte[255];
        byte[] b = new byte[255];

        for (int i = 0; i < 255; i++) {
            r[i] = (byte) ((i * 26) % 250);
            g[i] = (byte) ((i * 2) % 250);
            b[i] = (byte) ((i * 35) % 250);
        }//from   w  w  w  . j a  v a2s .  com

        return new IndexColorModel(8, 255, r, g, b);
    }
}

Related

  1. colorWithARGB(int alpha, int red, int green, int blue)
  2. colorWithIntAndAlpha(int color, int alpha)
  3. generateBlankImage(int w, int h, Color col)
  4. generateColor(int fc, int bc)
  5. generateColorFromString(String seed)
  6. generateColorRamp(int n)
  7. generateColourSet(Color[] palette, int numColorBands)
  8. generateFireMapColor(double min, double max, double value)
  9. generateGrayScaleColor(double min, double max, double value)