public class SColorFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static SColor |
add(SColor color1,
SColor color2)
Adds the two colors together.
|
static void |
addPalette(String name,
ArrayList<SColor> palette)
Places the palette into the cache, along with each of the member colors.
|
static void |
addPallet(String name,
ArrayList<SColor> palette)
Deprecated.
Prefer addPalette over this misspelled version; they are equivalent.
|
static ArrayList<SColor> |
asGradient(SColor color1,
SColor color2)
Returns a list of colors starting at the first color and moving to the
second color.
|
static SColor |
asSColor(com.badlogic.gdx.graphics.Color color)
Returns an SColor representation of the provided Color.
|
static SColor |
asSColor(float a,
float r,
float g,
float b)
Returns the cached color that matches the desired rgb value.
|
static SColor |
asSColor(int argb)
Returns the cached color that matches the desired rgb value.
|
static SColor |
asSColor(int r,
int g,
int b)
Returns an SColor that is opaque.
|
static SColor |
asSColor(int a,
int r,
int g,
int b)
Returns an SColor with the given values, with those values clamped
between 0 and 255.
|
static SColor |
blend(SColor color1,
SColor color2,
double coef)
Returns an SColor that is the given distance from the first color to the
second color.
|
static SColor |
colorForName(String s)
Returns the SColor Constant who's name is the one provided.
|
static SColor |
colorForValue(int rgb)
Returns the SColor who's value matches the one passed in.
|
static SColor |
desaturate(SColor color,
double percent)
Returns an SColor that is the version of the provided color desaturated
the given amount.
|
static SColor |
desaturated(SColor color)
Returns an SColor that is the fully desaturated (greyscale) version of
the provided color.
|
static SColor |
dim(SColor color)
Returns an SColor that is a slightly dimmer version of the provided
color.
|
static SColor |
dimmer(SColor color)
Returns an SColor that is a somewhat dimmer version of the provided
color.
|
static SColor |
dimmest(SColor color)
Returns an SColor that is a lot darker version of the provided color.
|
static void |
emptyCache()
Clears the backing cache.
|
static SColor |
fromPalette(String name,
float percent)
Returns the SColor that is the provided percent towards the end of the
palette.
|
static SColor |
fromPallet(String name,
float percent)
Deprecated.
Prefer fromPalette over this misspelled version; they are equivalent.
|
static SColor |
light(SColor color)
Returns an SColor that is a slightly lighter version of the provided
color.
|
static SColor |
lighter(SColor color)
Returns an SColor that is a somewhat lighter version of the provided
color.
|
static SColor |
lightest(SColor color)
Returns an SColor that is a lot lighter version of the provided color.
|
static SColor |
lightWith(SColor color,
SColor light)
Uses the second color as a light source, meaning that each of the red,
green, and blue values of the first color are multiplied by the lighting
color's percentage of full value (1.0).
|
static ArrayList<SColor> |
palette(String name)
Returns the palette associate with the provided name, or null if there is
no such palette.
|
static ArrayList<SColor> |
pallet(String name)
Deprecated.
Prefer palette over this misspelled version.
|
static int |
quantityCached()
Returns the number of SColor objects currently cached.
|
static SColor |
randomBlend(SColor color1,
SColor color2,
double min,
double max)
Returns an SColor that is randomly chosen from the color line between the
two provided colors from the two provided points.
|
static void |
setFloor(int value)
Sets the value at which each of the red, green, and blue values will be
set to the nearest lower multiple of.
|
public static SColor colorForName(String s)
s - public static SColor colorForValue(int rgb)
rgb - public static int quantityCached()
public static SColor blend(SColor color1, SColor color2, double coef)
color1 - The first colorcolor2 - The second colorcoef - The percent towards the second color, as 0.0 to 1.0public static SColor randomBlend(SColor color1, SColor color2, double min, double max)
color1 - color2 - min - The minimum percent towards the second color, as 0.0 to 1.0max - The maximum percent towards the second color, as 0.0 to 1.0public static SColor add(SColor color1, SColor color2)
color1 - color2 - public static SColor lightWith(SColor color, SColor light)
color - light - public static void emptyCache()
public static void setFloor(int value)
value - public static SColor asSColor(int argb)
argb - public static SColor asSColor(float a, float r, float g, float b)
a - r - g - b - public static SColor asSColor(int r, int g, int b)
r - g - b - public static SColor asSColor(int a, int r, int g, int b)
a - r - g - b - public static SColor asSColor(com.badlogic.gdx.graphics.Color color)
color - public static SColor dim(SColor color)
color - public static SColor dimmer(SColor color)
color - public static SColor dimmest(SColor color)
color - public static SColor light(SColor color)
color - public static SColor lighter(SColor color)
color - public static SColor lightest(SColor color)
color - public static SColor desaturated(SColor color)
color - public static SColor desaturate(SColor color, double percent)
color - percent - The percent to desaturate, from 0.0 for none to 1.0 for
fully desaturatedpublic static ArrayList<SColor> asGradient(SColor color1, SColor color2)
color1 - color2 - public static ArrayList<SColor> palette(String name)
name - public static ArrayList<SColor> pallet(String name)
name - public static SColor fromPalette(String name, float percent)
name - percent - public static SColor fromPallet(String name, float percent)
name - percent - public static void addPallet(String name, ArrayList<SColor> palette)
name - palette - public static void addPalette(String name, ArrayList<SColor> palette)
name - palette - Copyright © 2012–2015. All rights reserved.