RgbColor Class

Version 1.0.2
.NET Framework 4.7
Namespace Skybrud.Colors
Assembly Skybrud.Colors.dll
Visibility Public
Interfaces IColor
Inheritance Object

Class representing a color in the RGB color model. RGB stands for red, green, and blue.

public class RgbColor : IColor { }

Properties

Type Name Summary
Byte Red

Gets the amount of red in the color, specified as a value between 0 and 255.

Byte Green

Gets the amount of green in the color, specified as a value between 0 and 255.

Byte Blue

Gets the amount of blue in the color, specified as a value between 0 and 255.

Byte R

Alias of RgbColor.Red.

Byte G

Alias of RgbColor.Green.

Byte B

Alias of RgbColor.Blue.

Methods

Darken(float) (virtual)

Increases the darkness of the color based on the specified percent.

Lighten(float) (virtual)

Increases the lightness of the color based on the specified percent.

Parse(string) (static)

Parses the specified str into an instance of RgbColor.

ToCmy() (virtual)

Converts the RGB color to a CMY color.

ToCmyk() (virtual)

Converts the RGB color to a CMYK color.

ToCss() (virtual)

Returns the CSS representation of the color. The color will be expressed as rgb(0, 0, 0).

ToHex() (virtual)

Returns the HEX representation of the color.

ToHsl() (virtual)

Converts the RGB color to an HSL color.

ToRgb() (virtual)

Returns a new RgbColor with the same color as specified by the RgbColor.Red, RgbColor.Green and RgbColor.Blue properties.

ToString() (virtual)

Returns a string representation of the RGB color.

Attempts to parse the specified str into an instance of RgbColor.