Argb32Color class

Argb32Color class

Represents 32-bit color in ARGB format, with 8 bits per every channel (Alpha, Red, Green, Blue). Supports transparency.

This type is designed to be useful for (but not limited to) CSS operations. See more: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

The Argb32Color type exposes the following members:

Constructors

Constructor Description
init

Methods

Method Description
equals Checks whether this color is equal to the specified Argb32Color.
equals Determines whether this color is equal to the specified Rgb24Color.
equals Checks whether this color equals the specified uncasted color.
equals_argb_32_color
equals_object
equals_rgb_24_color
from_argb Creates a Argb32Color instance from a 32-bit ARGB value, compatible with values produced by System.Drawing.Color.ToArgb().
from_other_with_alpha Creates a new Argb32Color instance from the specified instance, but with a redefined alpha (opacity) value.
from_other_with_alpha Creates a new Argb32Color instance from a specified Rgb24Color, but with a specified alpha (opacity) value.
from_other_with_alpha_argb_32_color
from_other_with_alpha_rgb_24_color
from_rgb Creates an Argb32Color value from specified Red, Green, Blue channels, with the Alpha channel set to fully opaque.
from_rgba Creates an Argb32Color value from specified red, green, blue, and alpha channel values.
from_single_value_rgb Creates a fully opaque (A=255) color from a single byte value applied to all channels.
get_brightness Returns the Hue‑Saturation‑Lightness (HSL) lightness/brightness for this Argb32Color instance.
get_hash_code Returns a hash code that defines the current color; not compatible with System.Drawing.Color.GetHashCode.
get_hue Returns the Hue‑Saturation‑Lightness (HSL) hue value, in degrees, for this Argb32Color instance; if R == G == B, the hue is meaningless and the method returns 0.
get_saturation Returns the Hue‑Saturation‑Lightness (HSL) saturation of this Argb32Color instance.
to_argb Returns the ARGB value of this Argb32Color instance, compatible with System.Drawing.Color.ToArgb() method.
to_hex_rgb Serializes this Argb32Color instance to the hexadecimal notation ##RRGGBB as a string without the alpha channel.
to_hex_rgba Serializes this Argb32Color instance to the hexadecimal notation ##RRGGBBAA as a string with alpha channel.
to_rgb Serializes this Argb32Color instance to the rgb CSS function notation, omitting the alpha channel.
to_rgba Serializes this Argb32Color instance to the ‘rgba’ CSS function notation.
to_string Serializes the Argb32Color instance to the most appropriate CSS function notation depending on translucency.

Properties

Property Description
a The alpha component of the color as an 8-bit unsigned integer in the range 0..255.
alpha The alpha component of the color as a float in the range 0..1.
b The blue component of the color as an 8-bit unsigned integer in the range 0..255.
g The green component of the color as an 8-bit unsigned integer in the range 0..255.
is_default The property indicates whether this Argb32Color instance is default (transparent), meaning all four channels are set to 0; it is equivalent to Argb32Color.is_empty.
is_empty The property indicates whether this Argb32Color instance is uninitialized (all four channels are set to 0). It is equivalent to the default or transparent color and matches Argb32Color.is_default.
is_fully_opaque The property indicates whether this Argb32Color instance is fully opaque, without transparency (its Alpha channel has max value).
is_fully_transparent The property indicates whether this Argb32Color instance is fully transparent—its Alpha channel has the minimum (0) value, so the R, G, and B channels have no visible effect.
is_translucent The property indicates whether this Argb32Color instance is translucent (not fully transparent, but also not fully opaque).
r The red component of the color as an 8-bit unsigned integer (0..255).
value The 32-bit signed integer representation of the color.

Fields

Field Description
EMPTY Returns an empty color, which has no channels info and is fully transparent. Same as ‘’. Default value.
TRANSPARENT Fully transparent empty color. The same as default ’’ color value.

Example

from groupdocs.viewer.drawing import Argb32Color

# Create a fully opaque yellow color (RGB 255, 255, 0)
yellow = Argb32Color.from_rgb(255, 255, 0)

See Also