Package org.eclipse.lemminx.extensions.colors.utils

## Class ColorUtils

- java.lang.Object
- - org.eclipse.lemminx.extensions.colors.utils.ColorUtils

    public class ColorUtils
    extends Object

Color utilities. Some piece of code comes the vscode CSS language server written in TypeScript which has been translated to Java.

See Also:
  https://github.com/microsoft/vscode-css-languageservice/blob/main/src/languageFacts/colors.ts

### Constructor Summary

Constructors
`ColorUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static org.eclipse.lsp4j.Color` `getColorValue​(String text)` Returns the `Color` instance value from the given `text` and null otherwise.
`static int` `hexDigit​(int charCode)`
`static boolean` `isHexNumber​(String text)`
`static org.eclipse.lsp4j.ColorPresentation` `toHexa​(org.eclipse.lsp4j.Color color, org.eclipse.lsp4j.Range replace, boolean addHash)` Returns the Hexa color presentation of the given `color` and `replace` range.
`static org.eclipse.lsp4j.ColorPresentation` `toRGB​(org.eclipse.lsp4j.Color color, org.eclipse.lsp4j.Range replace)` Returns the RGB color presentation of the given `color` and `replace` range.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ColorUtils

    public ColorUtils()

### Method Detail

#### getColorValue

    public static org.eclipse.lsp4j.Color getColorValue​(String text)

Returns the `Color` instance value from the given `text` and null otherwise.

Parameters:
  `text` - the color text.
Returns:
  the `Color` instance value from the given `text` and null otherwise.

#### toRGB

    public static org.eclipse.lsp4j.ColorPresentation toRGB​(org.eclipse.lsp4j.Color color,
                                                            org.eclipse.lsp4j.Range replace)

Returns the RGB color presentation of the given `color` and `replace` range.

Parameters:
  `color` - the color.
  `replace` - the replace range.
Returns:
  the RGB color presentation of the given `color` and `range`.

#### toHexa

    public static org.eclipse.lsp4j.ColorPresentation toHexa​(org.eclipse.lsp4j.Color color,
                                                             org.eclipse.lsp4j.Range replace,
                                                             boolean addHash)

Returns the Hexa color presentation of the given `color` and `replace` range.

Parameters:
  `color` - the color.
  `replace` - the replace range.
Returns:
  the Hexa color presentation of the given `color` and `range`.

#### hexDigit

    public static int hexDigit​(int charCode)

#### isHexNumber

    public static boolean isHexNumber​(String text)