org.xwiki.gwt.wysiwyg.client.plugin.color
Class ColorConverter
java.lang.Object
org.xwiki.gwt.wysiwyg.client.plugin.color.ColorConverter
public class ColorConverter
- extends Object
Utility class for converting between different color formats.
- Version:
- $Id: f6b37f09324fc5d43596fb08825f5fe45074a761 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColorConverter
public ColorConverter()
convertToHex
public String convertToHex(String color)
- Converts the specified color code to hex code (as in
#F0F0EE). The following input formats are supported:
- IE's decimal integer format: 8242323
- RGB CSS expression:
rgb(255,125,75)
- CSS color names:
SpringGreen
. The input color is returned unchanged if it is already a hex code.
- Parameters:
color - a color code, in one of the supported formats
- Returns:
- the hex code of the specified color,
null if there's no matching hex code
rgbToHex
public String rgbToHex(String rgbColor)
- Converts a RGB expression to hex code.
- Parameters:
rgbColor - a RGB expression
- Returns:
- the hex color code matching the given RGB expression
colorNameToHex
public String colorNameToHex(String colorName)
- Parameters:
colorName - a CSS color name
- Returns:
- the hex code matching the specified color
decimalToHex
public String decimalToHex(String color)
- Parameters:
color - a decimal color code (Internet Explorer specific format)
- Returns:
- the hex code matching the specified color
Copyright © 2004-2012 XWiki. All Rights Reserved.