public class GFXColour extends Object
| Modifier and Type | Field and Description |
|---|---|
static GFXColour |
BLACK |
static int |
BLACK_INDEX
enumeration StandardColour: supported standard colours.
|
static GFXColour |
DARKGRAY |
static int |
DARKGRAY_INDEX |
static GFXColour |
GRAY |
static int |
GRAY_INDEX |
static int |
JF_GFXCOLOUR_DEF_SCALE |
static GFXColour |
LIGHTGRAY |
static int |
LIGHTGRAY_INDEX |
static int |
OTHER_INDEX |
static GFXColour |
WHITE |
static int |
WHITE_INDEX |
| Constructor and Description |
|---|
GFXColour()
Default constructor.
|
GFXColour(GFXColour oSource)
Copy consturctor.
|
GFXColour(int lNewR,
int lNewG,
int lNewB) |
GFXColour(int lNewR,
int lNewG,
int lNewB,
int lNewScale)
Constructor.
|
GFXColour(String sColour)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
b()
Get the current setting for Blue.
|
static GFXColour |
black()
Get a Black colour object.
|
static GFXColour |
create(int lNewR,
int lNewG,
int lNewB,
int lNewScale) |
static GFXColour |
create(String sColour) |
static GFXColour |
darkGray()
Get a Dark gray colour object.
|
boolean |
equals(Object object)
Equality comparison operator.
|
boolean |
equivalent(GFXColour oCompare)
Equality comparison.
|
int |
g()
Get the current setting for Green.
|
double |
getGrayRate()
Get the converted grayscale value of the RGB triplet as a percentage
|
int |
getGrayScale()
Get the converted grayscale value of the RGB triplet
|
static GFXColour |
getStandardColour(int colourIndex)
Get one of the predefined standard colour objects.
|
static int |
getStandardColourIndex(GFXColour oColour)
Get the defined standard colour as a StandardColour enumeration.
|
static GFXColour |
gray()
Get a Gray colour object.
|
int |
hashCode() |
static boolean |
isBlack(GFXColour oColour)
Check if a Colour object is set to black.
|
static boolean |
isWhite(GFXColour oColour)
Check if a Colour object is set to white.
|
static GFXColour |
lightGray()
Get a Light gray colour object.
|
double |
normalB()
Get the normalized value for Blue.
|
double |
normalG()
Get the normalized value for Green.
|
double |
normalR()
Get the normalized value for Red.
|
boolean |
notEqual(GFXColour oCompare)
Non-equality comparison operator.
|
int |
r()
Get the current setting for Red.
|
int |
scale()
Get the scale setting for this colour object.
|
GFXColour |
scale(int newScale) |
static GFXColour |
weightedAverage(GFXColour base,
GFXColour weighted,
double weight) |
static GFXColour |
white()
Get a White colour object.
|
boolean |
whiteMono()
Checks if this colour maps to white in a black and white scheme.
|
public static final int JF_GFXCOLOUR_DEF_SCALE
public static final int BLACK_INDEX
public static final int WHITE_INDEX
public static final int LIGHTGRAY_INDEX
public static final int GRAY_INDEX
public static final int DARKGRAY_INDEX
public static final int OTHER_INDEX
public static final GFXColour BLACK
public static final GFXColour WHITE
public static final GFXColour LIGHTGRAY
public static final GFXColour GRAY
public static final GFXColour DARKGRAY
public GFXColour()
Assigns the colour object with the following values:
Red = 0
Green = 0
Blue = 0
Scale = 255
public GFXColour(GFXColour oSource)
oSource - - Source attribute object to copypublic GFXColour(int lNewR,
int lNewG,
int lNewB,
int lNewScale)
Creates a Colour object with the values as specified by the input values.
lNewR - - Colour Red valuelNewG - - Colour Green valuelNewB - - Colour Blue valuelNewScale - - Scale settingpublic GFXColour(int lNewR,
int lNewG,
int lNewB)
public GFXColour(String sColour)
Set the all the colour values based on a text string.
sColour - - A string containing three integer values representing
red, green and blue.public static GFXColour create(int lNewR, int lNewG, int lNewB, int lNewScale)
public static GFXColour black()
This will return a Colour object with the following settings:
Red = 0
Green = 0
Blue = 0
Scale = 255
public static GFXColour white()
This will return a Colour object with the following settings:
Red = 255
Green = 255
Blue = 255
Scale = 255
public static GFXColour lightGray()
This will return a Colour object with the following settings:
Red = 192
Green = 192
Blue = 192
Scale = 255
public static GFXColour gray()
This will return a Colour object with the following settings:
Red = 128
Green = 128
Blue = 128
Scale = 255
public static GFXColour darkGray()
This will return a Colour object with the following settings:
Red = 64
Green = 64
Blue = 64
Scale = 255
public static GFXColour getStandardColour(int colourIndex)
colourIndex - - the requested colour as a StandardColour enumeration.public static int getStandardColourIndex(GFXColour oColour)
oColour - - the colour objectpublic static boolean isBlack(GFXColour oColour)
oColour - - the colour objectpublic static boolean isWhite(GFXColour oColour)
oColour - - the colour objectpublic int r()
public int g()
public int b()
public boolean whiteMono()
public double normalR()
public double normalG()
public double normalB()
public int scale()
public GFXColour scale(int newScale)
public boolean equivalent(GFXColour oCompare)
Two colour objects are considered equal if all their values compare for equality.
oCompare - - Colour object to compare against.public boolean equals(Object object)
Two colour objects are considered equal if all their values compare for equality.
public boolean notEqual(GFXColour oCompare)
Two colour objects are considered equal if all their values compare for equality.
oCompare - - Colour object to compare against.public int getGrayScale()
public double getGrayRate()
Copyright © 2010 - 2020 Adobe. All Rights Reserved