Class CSS2ColorHelper
java.lang.Object
org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetColorNameFromHexaColor(String hexaColor) Return the color name (ex : white) from Hexa color (ex : #FFFFFF).static StringReturn the hex string representation of the givencolor.static StringgetHexaColorFromColorName(String colorName) Return the Hexa color (ex : #FFFFFF) from color name (ex : white).static StringReturn hexadecimal (ex : #FFFFFF) color string value from the givencolor.static CssValues.CssColorgetRGBColor(String value) Return aCssValues.CssColorfrom string value.static StringReturn rgb (ex : rgb(0,0,0)) color string value from the givencolor.static booleanisColorName(String value) Return true ifvalueis color name (ex : white) and false otherwise.
-
Constructor Details
-
CSS2ColorHelper
public CSS2ColorHelper()
-
-
Method Details
-
getRGBColor
Return aCssValues.CssColorfrom string value. Format String value is hexadecimal like #FFFFFF or color name like white.- Parameters:
value- string representation of color- Returns:
- parsed color
-
getColorStringValue
Return the hex string representation of the givencolor.- Parameters:
color- the color to get a string representation for- Returns:
- the hex string representation of
color
-
getRGBColorStringValue
Return rgb (ex : rgb(0,0,0)) color string value from the givencolor.- Parameters:
color- the color to get string representation for- Returns:
- color as rgb(r, g, b) string
-
getHexaColorStringValue
Return hexadecimal (ex : #FFFFFF) color string value from the givencolor.- Parameters:
color- the color to get string representation for- Returns:
- color as hexa string
-
getHexaColorFromColorName
-
isColorName
Return true ifvalueis color name (ex : white) and false otherwise.- Parameters:
value- name of color to check- Returns:
trueif name is a known named color
-
getColorNameFromHexaColor
-