Here you can find the source of rgbFromGrayscale(int grayscale)
Parameter | Description |
---|---|
grayscale | The grayscale value such that (0 >= value <= 255) |
public static int rgbFromGrayscale(int grayscale)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww .j av a2s . c o m*/ * Converts a grayscale value into an RGB color space rgb integer. * @param grayscale The grayscale value such that (0 >= value <= 255) * @return An rgb integer in RGB color space. */ public static int rgbFromGrayscale(int grayscale) { return getRgb(grayscale, grayscale, grayscale); } /** * Returns an rgb integer in RGB color space from the specified red, green, and blue values. * @param red The red value (0 >= red <= 255). * @param green The green value (0 >= green <= 255). * @param blue The blue value (0 >= blue <= 255). * @return The rgb integer value in RGB color space. */ public static int getRgb(int red, int green, int blue) { return (red << 16) | (green << 8) | blue | (255 << 24); } }