- java.lang.Object
- com.anylogic.engine.presentation.UtilitiesColor
- All Implemented Interfaces:
ColorConstants
public final class UtilitiesColor extends Object implements ColorConstants
- Author:
- AnyLogic North America, LLC https://anylogic.com
Modifier and Type | Field | Description |
---|---|---|
static final Texture | brickRedTexture | |
static final Texture | brickWhiteTexture | |
static final Texture | concreteTexture | |
static final Texture | earthTexture | |
static final Texture | floorCarpetTexture | |
static final Texture | floorLinoTexture | |
static final Texture | floorMetalTexture | |
static final Texture | floorWoodTexture | |
static final Texture | grassTexture | |
static final Texture | gravelTexture | |
static final Texture | metalTexture | |
static final Texture | roofCeramicTexture | |
static final Texture | roofMetalTexture | |
static final Texture | sandTexture | |
static final Texture | snowTexture | |
static final Texture | tarmacTexture | |
static final Texture | waterTexture |
aliceBlue, ANTIQUE_WHITE, antiqueWhite, aqua, AQUA, aquamarine, AQUAMARINE, azure, AZURE, beige, BEIGE, bisque, BISQUE, black, BLACK, BLANCHED_ALMOND, blanchedAlmond, blue, BLUE, BLUE_VIOLET, blueViolet, brown, BROWN, BURLY_WOOD, burlyWood, CADET_BLUE, cadetBlue, chartreuse, CHARTREUSE, chocolate, CHOCOLATE, CONTROL_DEFAULT, controlDefault, coral, CORAL, CORNFLOWER_BLUE, cornflowerBlue, cornsilk, CORNSILK, crimson, CRIMSON, cyan, CYAN, DARK_BLUE, DARK_CYAN, DARK_GOLDENROD, DARK_GRAY, DARK_GREEN, DARK_KHAKI, DARK_MAGENTA, DARK_OLIVE_GREEN, DARK_ORANGE, DARK_ORCHID, DARK_RED, DARK_SALMON, DARK_SEA_GREEN, DARK_SLATE_BLUE, DARK_SLATE_GRAY, DARK_TURQUOISE, DARK_VIOLET, darkBlue, darkCyan, darkGoldenRod, darkGray, darkGreen, darkKhaki, darkMagenta, darkOliveGreen, darkOrange, darkOrchid, darkRed, darkSalmon, darkSeaGreen, darkSlateBlue, darkSlateGray, darkTurquoise, darkViolet, DEEP_PINK, DEEP_SKY_BLUE, deepPink, deepSkyBlue, defaultElevatorWallsColor, defaultGisFillColor, defaultGisLineColor, DIM_GRAY, dimGray, DODGER_BLUE, dodgerBlue, feldspar, FELDSPAR, FIRE_BRICK, fireBrick, FLORAL_WHITE, floralWhite, FOREST_GREEN, forestGreen, fuchsia, FUCHSIA, gainsboro, GAINSBORO, GHOST_WHITE, ghostWhite, gold, GOLD, GOLDEN_ROD, goldenRod, gray, GRAY, green, GREEN, GREEN_YELLOW, greenYellow, HONEY_DEW, honeyDew, HOT_PINK, hotPink, INDIAN_RED, indianRed, indigo, INDIGO, ivory, IVORY, khaki, KHAKI, lavender, LAVENDER, LAVENDER_BLUSH, lavenderBlush, LAWN_GREEN, lawnGreen, LEMON_CHIFFON, lemonChiffon, LIGHT_BLUE, LIGHT_CORAL, LIGHT_CYAN, LIGHT_GOLDEN_ROD_YELLOW, LIGHT_GREEN, LIGHT_GREY, LIGHT_PINK, LIGHT_SALMON, LIGHT_SEA_GREEN, LIGHT_SKY_BLUE, LIGHT_SLATE_BLUE, LIGHT_SLATE_GRAY, LIGHT_STEEL_BLUE, LIGHT_YELLOW, lightBlue, lightCoral, lightCyan, lightGoldenRodYellow, lightGreen, lightGrey, lightPink, lightSalmon, lightSeaGreen, lightSkyBlue, lightSlateBlue, lightSlateGray, lightSteelBlue, lightYellow, lime, LIME, LIME_GREEN, limeGreen, linen, LINEN, magenta, MAGENTA, markupDefaultBulkConveyorBelt, markupDefaultConveyorSpurFillColor, markupDefaultConveyorSpurLineColor, markupDefaultLiftFillColor, markupDefaultLiftLineColor, markupDefaultMaterialHandling, markupDefaultNetwork, markupDefaultPedestrian, markupDefaultPedestrianReverse, markupDefaultPipe, markupDefaultPointOnTrack, markupDefaultStorageTank, markupDefaultSwitch, markupDefaultSwitchPath, markupDefaultSwitchSelection, markupDefaultTrack, markupDefaultWall, maroon, MAROON, MAX_COLORS, MEDIUM_AQUA_MARINE, MEDIUM_BLUE, MEDIUM_ORCHID, MEDIUM_PURPLE, MEDIUM_SEAGREEN, MEDIUM_SLATEBLUE, MEDIUM_SPRINGGREEN, MEDIUM_TURQUOISE, MEDIUM_VIOLETRED, mediumAquaMarine, mediumBlue, mediumOrchid, mediumPurple, mediumSeaGreen, mediumSlateBlue, mediumSpringGreen, mediumTurquoise, mediumVioletRed, MIDNIGHT_BLUE, midnightBlue, MINT_CREAM, mintCream, MISTY_ROSE, mistyRose, moccasin, MOCCASIN, NAVAJO_WHITE, navajoWhite, navy, NAVY, OLD_LACE, oldLace, olive, OLIVE, OLIVE_DRAB, oliveDrab, orange, ORANGE, ORANGE_RED, orangeRed, orchid, ORCHID, PALE_GOLDEN_ROD, PALE_GREEN, PALE_TURQUOISE, PALE_VIOLET_RED, paleGoldenRod, paleGreen, paleTurquoise, paleVioletRed, PAPAYA_WHIP, papayaWhip, PEACH_PUFF, peachPuff, peru, PERU, pink, PINK, plum, PLUM, POWDER_BLUE, powderBlue, purple, PURPLE, red, RED, ROSY_BROWN, rosyBrown, ROYAL_BLUE, royalBlue, SADDLE_BROWN, saddleBrown, salmon, SALMON, SANDY_BROWN, sandyBrown, SEA_GREEN, SEA_SHELL, seaGreen, seaShell, sienna, SIENNA, silver, SILVER, SKY_BLUE, skyBlue, SLATE_BLUE, SLATE_GRAY, slateBlue, slateGray, snow, SNOW, SPRING_GREEN, springGreen, STEEL_BLUE, steelBlue, tan, TAN, teaGreen, teal, TEAL, thistle, THISTLE, tomato, TOMATO, transparent, TRANSPARENT, turquoise, TURQUOISE, uranianBlue, violet, VIOLET, VIOLET_RED, violetRed, wheat, WHEAT, white, WHITE, WHITE_SMOKE, whiteSmoke, yellow, YELLOW, YELLOW_GREEN, yellowGreen
Modifier and Type | Method | Description |
---|---|---|
static Color | darker |
Creates a new color darker than the original color by a given factor.
|
static final Color | getStandardColor |
Returns a standard color with the given index, or null if the
index is out of range [0..
ColorConstants.MAX_COLORS ]. |
static final Integer | indexToIntColorConstant |
Deprecated.
|
static Color | lerpColor |
Returns a new Color - a point on a linear interpolation between
from and to Colors, whose position is defined by
frac :
if frac <= 0 from is returned,
if frac >= 1 , to is returned,
otherwise a color in between. |
static Color | semiTransparent |
Creates a semitransparent version of the given color, regardless of
its original transparency.
|
static Color | spectrumColor |
Returns a good looking spectrum color constructed from a given
integer repeated with a given period.
|
static Color | transparent |
Creates a transparent version of the given color, regardless of
its original transparency.
|
public static final Texture grassTexture
public static final Texture tarmacTexture
public static final Texture sandTexture
public static final Texture gravelTexture
public static final Texture brickRedTexture
public static final Texture brickWhiteTexture
public static final Texture concreteTexture
public static final Texture roofCeramicTexture
public static final Texture roofMetalTexture
public static final Texture waterTexture
public static final Texture floorWoodTexture
public static final Texture floorMetalTexture
public static final Texture floorLinoTexture
public static final Texture floorCarpetTexture
public static final Texture earthTexture
public static final Texture snowTexture
public static final Texture metalTexture
@AnyLogicLegacyAPI @Deprecated public static final Integer indexToIntColorConstant(int indexc)
Deprecated.
Returns a standard color (as integer) of a given index.
- Parameters:
indexc
- the index of a color- Returns:
- the integer representation of the color
public static final Color getStandardColor(int index)
Returns a standard color with the given index, or null if the
index is out of range [0..
ColorConstants.MAX_COLORS
].- Parameters:
index
- the color index- Returns:
- the standard color
public static Color lerpColor(double frac, Color from, Color to)
Returns a new Color - a point on a linear interpolation between
from and to Colors, whose position is defined by
frac
:
if frac <= 0
from
is returned,
if frac >= 1
, to
is returned,
otherwise a color in between.- Parameters:
frac
- a value defining where the color should befrom
- the start color, corresponds tofrac = 0
to
- the end color, corresponds tofrac = 1
- Returns:
- a new color
public static Color semiTransparent(Color c)
Creates a semitransparent version of the given color, regardless of
its original transparency.
- Parameters:
c
- the original color- Returns:
- semitransparent c (with 'alpha' value of 128)
public static Color transparent(Color c, double fraction)
Creates a transparent version of the given color, regardless of
its original transparency.
- Parameters:
c
- the original colorfraction
- transparency fraction: 0..1, where 0=transparent, 1=opaque- Returns:
- c with transparency
- Since:
- 7.2
public static Color darker(Color c, double factor)
Creates a new color darker than the original color by a given factor.
- Parameters:
c
- the original colorfactor
- should be in range [0..1]- Returns:
- a color darker than c by the factor
public static Color spectrumColor(int index, int period)
Returns a good looking spectrum color constructed from a given
integer repeated with a given period.
- Parameters:
index
- the index of the colorperiod
- the number of unique colors- Returns:
- a spectrum color corresponding to the index