Gimp.color_parse_css_substring
Description: Reference for Gimp.color_parse_css_substring

### Function

# Gimpcolor_parse_css_substring

since: 2.2

#### Declaration [src]

    GeglColor*
    gimp_color_parse_css_substring (
      const gchar* css,
      gint len
    )

#### Description [src]

Attempts to parse a string describing an sRGB color in CSS notation. This can be either a numerical representation (`rgb(255,0,0)` or `rgb(100%,0%,0%)`) or a hexadecimal notation as parsed by `gimp_color_parse_hex()` (`##ff0000`) or a color name as parsed by `gimp_color_parse_name()` (`red`).

Additionally the `rgba()`, `hsl()` and `hsla()` functions are supported too.

Available since: 2.2

This function is not directly available to language bindings.

skip-reason | provided_by_gimp_color_parse_css_since_106d1860

#### Parameters

`css`

  Type: An array of `gchar`

  A string describing a color in CSS notation.

  The length of the array is specified in the `len` argument.
  The data is owned by the caller of the function.
  Each element is a NUL terminated UTF-8 string.

`len`

  Type: `gint`

  The length of `css`, in bytes. or -1 if `css` is nul-terminated.

#### Return value

Type: `GeglColor`

A newly allocated `GeglColor` if `css` was parsed successfully, `NULL` otherwise.

The caller of the function takes ownership of the data, and is responsible for freeing it.