AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.presentation.UtilitiesColor
All Implemented Interfaces:
ColorConstants

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

Field Summary

Fields 
static Texture brickRedTexture  
static Texture brickWhiteTexture  
static Texture concreteTexture  
static Texture earthTexture  
static Texture floorCarpetTexture  
static Texture floorLinoTexture  
static Texture floorMetalTexture  
static Texture floorWoodTexture  
static Texture grassTexture  
static Texture gravelTexture  
static Texture metalTexture  
static Texture roofCeramicTexture  
static Texture roofMetalTexture  
static Texture sandTexture  
static Texture snowTexture  
static Texture tarmacTexture  
static Texture waterTexture  
Modifier and Type Field Description

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

All Methods Static Methods Concrete Methods Deprecated Methods 
static java.awt.Color darker​(java.awt.Color c, double factor)
Creates a new color darker than the original color by a given factor.
static java.awt.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].
static java.lang.Integer indexToIntColorConstant​(int indexc)
Deprecated.
static java.awt.Color lerpColor​(double frac, java.awt.Color from, java.awt.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 java.awt.Color semiTransparent​(java.awt.Color c)
Creates a semitransparent version of the given color, regardless of its original transparency.
static java.awt.Color spectrumColor​(int index, int period)
Returns a good looking spectrum color constructed from a given integer repeated with a given period.
static java.awt.Color transparent​(java.awt.Color c, double fraction)
Creates a transparent version of the given color, regardless of its original transparency.
Modifier and Type Method Description

Methods inherited from class java.lang.Object

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

Field Detail

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 Detail

indexToIntColorConstant

@AnyLogicLegacyAPI
@Deprecated
public static final java.lang.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 java.awt.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 java.awt.Color lerpColor​(double frac,
                                       java.awt.Color from,
                                       java.awt.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 java.awt.Color semiTransparent​(java.awt.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 java.awt.Color transparent​(java.awt.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 java.awt.Color darker​(java.awt.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 java.awt.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