# IC Python API:RLPy RColor

Main article: Modules.

## Detailed Description

This class represent the color data RGBA.

## Operators

This class supports the following operators:

Member Operation Syntax Description Example
__add__ Addition a + b Adds values on either side of the operator. a + b = 30
__sub__ Subtraction a - b Subtracts right hand operand from left hand operand. a – b = -10
__mul__ Multiplication a * b Multiplies values on either side of the operator. a * b = 200
__truediv__ Division a / b Divides left hand operand by right hand operand. b / a = 2
__neg__ Negation -a Return the value negated. a = -b
__pos__ Positive +a Return value positive. a = +b
__eq__ Equality a == b If the values of two operands are equal, then the condition becomes true. (a == b) is not true.
__ne__ Difference a != b If values of two operands are not equal, then condition becomes true. (a != b) is true.
__lt__ Less Than a < b If the value of left operand is less than the value of right operand, then condition becomes true. (a < b) is true.
__iadd__ Addition (Inplace) a += b It adds right operand to the left operand and assign the result to left operand. c += a is equivalent to c = c + a
__isub__ Subtraction (Inplace) a -= b It subtracts right operand from the left operand and assign the result to left operand. c -= a is equivalent to c = c - a
__imul__ Multiply (Inplace) a *= b It multiplies right operand with the left operand and assign the result to left operand. c *= a is equivalent to c = c * a
__itruediv__ Divide (Inplace) a /= b It divides left operand with the right operand and assign the result to left operand. c /= a is equivalent to c = c / ac /= a is equivalent to c = c / a

## Member Functions

### A

```RLPy.RColor.A ( self, args )
```

Get the value of the color-Alpha.

#### Returns

The value of the color-Alpha - float

```RLPy.RColor.AdjustHSBC ( self, fHue, fSaturate, fBrightness, fContrast, bInvert )
```

Use HSBC way to adjust the color.

#### Parameters

fHue [in] Hue value - float

fSaturate [in] Saturate value - float

fBrightness [in] Brightness value - float

fContrast [in] Contrast value - float

bInvert [in] If invert - bool

```RLPy.RColor.AdjustRGBA ( self, fRed, fGreen, fBlue, fAlpha, bInvert )
```

Use RGBA way to adjust the color.

#### Parameters

fRed [in] Red value - float

fGreen [in] Green value - float

fBlue [in] Blue value - float

fAlpha [in] Alpha value - float

bInvert [in] If invert - bool

### Alpha

```RLPy.RColor.Alpha ( self )
```

Get the value of the color-Alpha.

#### Returns

The value of the color-Alpha(value: 0~255) - int

### B

```RLPy.RColor.B ( self, args )
```

Get the value of the color-Blue.

#### Returns

The value of the color-Blue - float

### Blue

```RLPy.RColor.Blue ( self )
```

Get the value of the color-Blue.

#### Returns

The value of the color-Blue(value: 0~255) - int

### From

```RLPy.RColor.From ( self, r, g, b, a )
```

Convert unsigned char rgba data to CColor.

#### Parameters

r [IN] the unsigned char value of red - string

g [IN] the unsigned char value of green - string

b [IN] the unsigned char value of blue - string

a [IN] the unsigned char value of alpha - string

#### Returns

The CRgb data - RLPy.RColor

### FromARGB

```RLPy.RColor.FromARGB ( self, arg2 )
```

Convert ARGB to CColor.

#### Parameters

[IN] the unsigned long ARGB value.

#### Returns

The CColor data - RLPy.RColor

### FromCOLORREF

```RLPy.RColor.FromCOLORREF ( self, arg2 )
```

Convert COLORREF to CColor.

#### Parameters

[IN] the unsigned long COLORREF value.

#### Returns

The CColor data - RLPy.RColor

### FromHSL

```RLPy.RColor.FromHSL ( self, fHue, fSaturate, fLevel )
```

Convert the HSL data to rgba data.

#### Parameters

fHue [in] Hue value - float

fSaturate [in] Saturate value - float

fLevel [in] Lightness value - float

### G

```RLPy.RColor.G ( self, args )
```

Get the value of the color-Green.

#### Returns

The value of the color-Green - float

### GammaCorrect

```RLPy.RColor.GammaCorrect ( self, fGamma )
```

Returns the gamma value.

#### Returns

The gamma value of the rgba data - RLPy.RColor

### Green

```RLPy.RColor.Green ( self )
```

Get the value of the color-Green.

#### Returns

The value of the color-Green(value: 0~255) - int

### Normalize

```RLPy.RColor.Normalize ( self )
```

Normalizes this rgba vector.

#### Returns

The normalized rgba vector - RLPy.RColor

### R

```RLPy.RColor.R ( self, args )
```

Get the value of the color-Red.

#### Returns

The value of the color-Red - float

### Red

```RLPy.RColor.Red ( self )
```

Get the value of the color-Red.

#### Returns

The value of the color-Red(value: 0~255) - int

### Saturate

```RLPy.RColor.Saturate ( self )
```

Saturates this rgba vector.

#### Returns

The saturated rgba vector - RLPy.RColor

### ToARGB

```RLPy.RColor.ToARGB ( self )
```

Convert CColor to ARGB.

#### Returns

The ARGB data - int

### ToCOLORREF

```RLPy.RColor.ToCOLORREF ( self )
```

Convert CColor to COLORREF.

#### Returns

The COLORREF data - int

### ToGrayScale

```RLPy.RColor.ToGrayScale ( self )
```

Returns gray scale.

#### Returns

The gray scale - float

### ToHSL

```RLPy.RColor.ToHSL ( self, fHue, fSaturate, fLevel )
```

Convert the rgba data to HSL data.

#### Parameters

fHue [OUT] Hue value - float

fSaturate [OUT] Saturate value - float

fLevel [OUT] Lightness value - float