public class PixelColour extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BLUE |
static int |
COLOUR_COMPONENT_MAX |
static int |
GREEN |
static int |
LIGHT_BLUE |
static int |
ORANGE |
static int |
PINK |
static int |
PURPLE |
static int[] |
RAINBOW |
static int |
RED |
static int |
YELLOW |
| Constructor and Description |
|---|
PixelColour() |
| Modifier and Type | Method and Description |
|---|---|
static int |
createColourHSB(float hue,
float saturation,
float brightness)
Creates a colour based on the specified values in the HSB colour model.
|
static int |
createColourHSL(float hue,
float saturation,
float luminance)
Creates a colour based on the specified values in the HSL colour model.
|
static int |
createColourRGB(float red,
float green,
float blue)
Create a colour from relative RGB values
|
static int |
createColourRGB(int red,
int green,
int blue)
Create a colour from int RGB values
|
static int |
getBlueComponent(int colour) |
static int |
getGreenComponet(int colour) |
static int |
getRedComponent(int colour) |
static int |
setBlueComponent(int colour,
int blue) |
static int |
setGreenComponent(int colour,
int green) |
static int |
setRedComponent(int colour,
int red) |
static void |
validateColourComponent(String colour,
int value) |
static int |
wheel(int wheelPos)
Input a value 0 to 255 to get a colour value.
|
public static final int RED
public static final int ORANGE
public static final int YELLOW
public static final int GREEN
public static final int LIGHT_BLUE
public static final int BLUE
public static final int PURPLE
public static final int PINK
public static final int[] RAINBOW
public static final int COLOUR_COMPONENT_MAX
public static int wheel(int wheelPos)
wheelPos - Position on the colour wheel (range 0..255).public static int createColourRGB(float red,
float green,
float blue)
red - Red %, 0 to 1green - Green %, 0 to 1blue - Blue %, 0 to 1public static int createColourRGB(int red,
int green,
int blue)
red - Red component 0 to 255green - Green component 0 to 255blue - Blue component 0 to 255public static int createColourHSB(float hue,
float saturation,
float brightness)
hue - The hue, in degrees, 0.0 to 1.0saturation - The saturation %, 0.0 to 1.0brightness - The brightness %, 0.0 to 1.0IllegalArgumentException - if hue, saturation, brightness are out of rangepublic static int createColourHSL(float hue,
float saturation,
float luminance)
hue - The hue, in degrees, 0.0 to 360.0saturation - The saturation %, 0.0 to 1.0luminance - The luminance %, 0.0 to 1.0IllegalArgumentException - if hue, saturation, brightness are out of rangepublic static void validateColourComponent(String colour, int value)
public static int getRedComponent(int colour)
public static int setRedComponent(int colour,
int red)
public static int getGreenComponet(int colour)
public static int setGreenComponent(int colour,
int green)
public static int getBlueComponent(int colour)
public static int setBlueComponent(int colour,
int blue)
Copyright © 2016 mattjlewis. All rights reserved.