Package org.yamcs.studio.script
Class ColorFontUtil
java.lang.Object
org.yamcs.studio.script.ColorFontUtil
- Direct Known Subclasses:
ColorFontUtil
Utility class to facilitate Javascript programming for color operation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RGBthe color of blackstatic final RGBthe color of bluestatic final RGBthe color of cyanstatic final RGBthe color of dark graystatic final RGBthe color of graystatic final RGBthe color of greenstatic final RGBthe color of light bluestatic final RGBthe color of orangestatic final RGBthe color of pinkstatic final RGBthe color of orangestatic final RGBthe color of redstatic final RGBthe color of whitestatic final RGBthe color of yellow -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final RGBgetColorFromHSB(float hue, float saturation, float brightness) Get a color with the given hue, saturation, and brightness.static final RGBgetColorFromRGB(int red, int green, int blue) Get a color with the given red, green and blue values.static final FontDataGet a new font data given a font name, the height of the desired font in points, and a font style.
-
Field Details
-
BLACK
the color of black -
BLUE
the color of blue -
CYAN
the color of cyan -
DARK_GRAY
the color of dark gray -
GRAY
the color of gray -
GREEN
the color of green -
LIGHT_BLUE
the color of light blue -
ORANGE
the color of orange -
PINK
the color of pink -
PURPLE
the color of orange -
RED
the color of red -
WHITE
the color of white -
YELLOW
the color of yellow
-
-
Constructor Details
-
ColorFontUtil
public ColorFontUtil()
-
-
Method Details
-
getColorFromRGB
Get a color with the given red, green and blue values.- Parameters:
red- the red component of the new instancegreen- the green component of the new instanceblue- the blue component of the new instance- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255
-
getColorFromHSB
Get a color with the given hue, saturation, and brightness.- Parameters:
hue- the hue value for the HSB color (from 0 to 360)saturation- the saturation value for the HSB color (from 0 to 1)brightness- the brightness value for the HSB color (from 0 to 1)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the hue is not between 0 and 360 or the saturation or brightness is not between 0 and 1
-
getFont
Get a new font data given a font name, the height of the desired font in points, and a font style.- Parameters:
name- the name of the font (must not be null)height- the font height in pointsstyle- A bitwise combination of NORMAL(0), BOLD(1) and ITALIC(2).- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - when the font name is null
- ERROR_INVALID_ARGUMENT - if the height is negative
-