iText 8.0.5 API
iText.Kernel.Colors.WebColors Class Reference

This class is a HashMap that contains the names of colors as a key and the corresponding RGB color as value. More...

Inheritance diagram for iText.Kernel.Colors.WebColors:

Static Public Member Functions

static DeviceRgb  GetRGBColor (String name)
  Gives you a DeviceRgb based on a name. More...
 
static DeviceCmyk  GetCMYKColor (String name)
  Gives you a DeviceCmyk based on a name. More...
 
static float[]  GetCMYKArray (String name)
  Gives an array of five floats that contain CMYK values and opacity, each value is between 0 and 1. More...
 
static float[]  GetRGBAColor (String name)
  Gives an array of four floats that contain RGBA values, each value is between 0 and 1. More...
 

Static Public Attributes

static readonly WebColors  NAMES = new WebColors()
  HashMap containing all the names and corresponding color values. More...
 

Detailed Description

This class is a HashMap that contains the names of colors as a key and the corresponding RGB color as value.

This class is a HashMap that contains the names of colors as a key and the corresponding RGB color as value. (Source: Wikipedia http://en.wikipedia.org/wiki/Web_colors )

Member Function Documentation

◆ GetCMYKArray()

static float [] iText.Kernel.Colors.WebColors.GetCMYKArray ( String  name )
inlinestatic

Gives an array of five floats that contain CMYK values and opacity, each value is between 0 and 1.

Parameters
name 'device-cmyk(c, m, y, k)' structure
Returns
the corresponding array of five floats, or null if parsing failed.

◆ GetCMYKColor()

static DeviceCmyk iText.Kernel.Colors.WebColors.GetCMYKColor ( String  name )
inlinestatic

Gives you a DeviceCmyk based on a name.

Parameters
name 'device-cmyk(c, m, y, k)' structure
Returns
the corresponding DeviceCmyk object. Never returns null.

◆ GetRGBAColor()

static float [] iText.Kernel.Colors.WebColors.GetRGBAColor ( String  name )
inlinestatic

Gives an array of four floats that contain RGBA values, each value is between 0 and 1.

Parameters
name a name such as black, violet, cornflowerblue or #RGB or #RRGGBB or RGB or RRGGBB or rgb(R,G,B) or rgb(R,G,B,A)
Returns
the corresponding array of four floats, or null if parsing failed.

◆ GetRGBColor()

static DeviceRgb iText.Kernel.Colors.WebColors.GetRGBColor ( String  name )
inlinestatic

Gives you a DeviceRgb based on a name.

Parameters
name a name such as black, violet, cornflowerblue or #RGB or #RRGGBB or RGB or RRGGBB or rgb(R,G,B)
Returns
the corresponding DeviceRgb object. Never returns null.

Member Data Documentation

◆ NAMES

readonly WebColors iText.Kernel.Colors.WebColors.NAMES = new WebColors()
static

HashMap containing all the names and corresponding color values.