AnyLogic
Expand
Font size
All Implemented Interfaces:
ColorConstants

public final class UtilitiesColor
extends Object
implements ColorConstants
Author:
AnyLogic North America, LLC https://anylogic.com

Field Summary

Modifier and TypeFieldDescription
static final TexturebrickRedTexture 
static final TexturebrickWhiteTexture 
static final TextureconcreteTexture 
static final TextureearthTexture 
static final TexturefloorCarpetTexture 
static final TexturefloorLinoTexture 
static final TexturefloorMetalTexture 
static final TexturefloorWoodTexture 
static final TexturegrassTexture 
static final TexturegravelTexture 
static final TexturemetalTexture 
static final TextureroofCeramicTexture 
static final TextureroofMetalTexture 
static final TexturesandTexture 
static final TexturesnowTexture 
static final TexturetarmacTexture 
static final TexturewaterTexture 

Fields inherited from interface com.anylogic.engine.presentation.ColorConstants

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

Method Summary

Modifier and TypeMethodDescription
static Colordarker(Color c, double factor)
Creates a new color darker than the original color by a given factor.
static final ColorgetStandardColor(int index)
Returns a standard color with the given index, or null if the index is out of range [0..ColorConstants.MAX_COLORS].
static final IntegerindexToIntColorConstant(int indexc)
Deprecated.
static ColorlerpColor(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.
static ColorsemiTransparent(Color c)
Creates a semitransparent version of the given color, regardless of its original transparency.
static ColorspectrumColor(int index, int period)
Returns a good looking spectrum color constructed from a given integer repeated with a given period.
static Colortransparent(Color c, double fraction)
Creates a transparent version of the given color, regardless of its original transparency.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

grassTexture

public static final Texture grassTexture

tarmacTexture

public static final Texture tarmacTexture

sandTexture

public static final Texture sandTexture

gravelTexture

public static final Texture gravelTexture

brickRedTexture

public static final Texture brickRedTexture

brickWhiteTexture

public static final Texture brickWhiteTexture

concreteTexture

public static final Texture concreteTexture

roofCeramicTexture

public static final Texture roofCeramicTexture

roofMetalTexture

public static final Texture roofMetalTexture

waterTexture

public static final Texture waterTexture

floorWoodTexture

public static final Texture floorWoodTexture

floorMetalTexture

public static final Texture floorMetalTexture

floorLinoTexture

public static final Texture floorLinoTexture

floorCarpetTexture

public static final Texture floorCarpetTexture

earthTexture

public static final Texture earthTexture

snowTexture

public static final Texture snowTexture

metalTexture

public static final Texture metalTexture

Method Details

indexToIntColorConstant

@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

getStandardColor

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

lerpColor

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 be
from - the start color, corresponds to frac = 0
to - the end color, corresponds to frac = 1
Returns:
a new color

semiTransparent

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)

transparent

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 color
fraction - transparency fraction: 0..1, where 0=transparent, 1=opaque
Returns:
c with transparency
Since:
7.2

darker

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 color
factor - should be in range [0..1]
Returns:
a color darker than c by the factor

spectrumColor

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 color
period - the number of unique colors
Returns:
a spectrum color corresponding to the index