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
Modifier and TypeFieldDescriptionstatic final RGB
the color of blackstatic final RGB
the color of bluestatic final RGB
the color of cyanstatic final RGB
the color of dark graystatic final RGB
the color of graystatic final RGB
the color of greenstatic final RGB
the color of light bluestatic final RGB
the color of orangestatic final RGB
the color of pinkstatic final RGB
the color of orangestatic final RGB
the color of redstatic final RGB
the color of whitestatic final RGB
the color of yellow -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final RGB
getColorFromHSB
(float hue, float saturation, float brightness) Get a color with the given hue, saturation, and brightness.static final RGB
getColorFromRGB
(int red, int green, int blue) Get a color with the given red, green and blue values.static final FontData
Get 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
-