Here you can find the source of toColor(byte red, byte green, byte blue)
Parameter | Description |
---|---|
red | The red component (up to 255) of the color to convert |
green | The green component (up to 255) of the color to convert |
blue | The blue component (up to 255) of the color to convert |
public static Color toColor(byte red, byte green, byte blue)
//package com.java2s; /*//from w w w. j a va 2s . co m * ColorHelper.java * * Copyright (c) 2015 TheRoBrit * * Nucli is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nucli is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import java.awt.*; public class Main { /** * Convert RGB color model to a {@link Color} object * @param red The red component (up to 255) of the color to convert * @param green The green component (up to 255) of the color to convert * @param blue The blue component (up to 255) of the color to convert * @return The {@link Color} object for the color */ public static Color toColor(byte red, byte green, byte blue) { return new Color(red, green, blue); } /** * Convert integer to a {@link Color} object * @param color The integer representation of a color * @return The {@link Color} object for the color */ public static Color toColor(int color) { return new Color(color); } }