- Classes
- Namespaces
- Interfaces
- Traits
- Index

Class

# Imagine\Image\Palette\Color\RGB

class RGB implements ColorInterface

## Methods

| __construct(RGB $palette, array $color, $alpha) |
Integer | getValue(string $component) Return the value of one of the component. |
integer | getRed() Returns RED value of the color |
integer | getGreen() Returns GREEN value of the color |
integer | getBlue() Returns BLUE value of the color |
PaletteInterface | getPalette() Returns the palette attached to the current color |
integer | getAlpha() Returns percentage of transparency of the color |
ColorInterface | dissolve(integer $alpha) Returns a copy of current color, incrementing the alpha channel by the given amount |
ColorInterface | lighten(integer $shade) Returns a copy of the current color, lightened by the specified number of shades |
ColorInterface | darken(integer $shade) Returns a copy of the current color, darkened by the specified number of shades |
ColorInterface | grayscale() Returns a gray related to the current color |
Boolean | isOpaque() Checks if the current color is opaque |
string | __toString() Returns hex representation of the color |

## Details

###
at line 45
`public __construct(RGB $palette, array $color, $alpha)`

#### Parameters

RGB | $palette |
array | $color |
| $alpha |

###
at line 55
`public Integer getValue(string $component)`

Return the value of one of the component.

#### Parameters

string | $component | One of the ColorInterface::COLOR_* component

#### Return Value

Integer |

###
at line 74
`public integer getRed()`

Returns RED value of the color

#### Return Value

integer |

###
at line 84
`public integer getGreen()`

Returns GREEN value of the color

#### Return Value

integer |

###
at line 94
`public integer getBlue()`

Returns BLUE value of the color

#### Return Value

integer |

###
at line 102
`public PaletteInterface getPalette()`

Returns the palette attached to the current color

#### Return Value

PaletteInterface |

###
at line 110
`public integer getAlpha()`

Returns percentage of transparency of the color

#### Return Value

integer |

###
at line 118
`public ColorInterface dissolve(integer $alpha)`

Returns a copy of current color, incrementing the alpha channel by the given amount

#### Parameters

integer | $alpha |

#### Return Value

ColorInterface |

###
at line 126
`public ColorInterface lighten(integer $shade)`

Returns a copy of the current color, lightened by the specified number of shades

#### Parameters

integer | $shade |

#### Return Value

ColorInterface |

###
at line 140
`public ColorInterface darken(integer $shade)`

Returns a copy of the current color, darkened by the specified number of shades

#### Parameters

integer | $shade |

#### Return Value

ColorInterface |

###
at line 154
`public ColorInterface grayscale()`

Returns a gray related to the current color

#### Return Value

ColorInterface |

###
at line 164
`public Boolean isOpaque()`

Checks if the current color is opaque

#### Return Value

Boolean |

###
at line 174
`public string __toString()`

Returns hex representation of the color

#### Return Value

string |