xtd 0.2.0
argb.hpp
Go to the documentation of this file.
1
4#pragma once
5#include <xtd/byte>
6#include <xtd/uint32>
7
9namespace xtd {
11 namespace drawing {
13 namespace helpers {
23 struct argb {
25
29 xtd::byte a = 255;
40
42
47 static argb from_uint32(uint32 value) noexcept {
48 return argb {
49 .a = static_cast<xtd::byte>((value & 0xFF000000) >> 24),
50 .r = static_cast<xtd::byte>((value & 0x00FF0000) >> 16),
51 .g = static_cast<xtd::byte>((value & 0x0000FF00) >> 8),
52 .b = static_cast<xtd::byte>(value & 0x000000FF)
53 };
54 }
56 };
57 }
58 }
59}
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
The argb struct.
Definition argb.hpp:23
xtd::byte g
Gets or sets the green component value of this xtd::drawing::helpers::argb struct.
Definition argb.hpp:35
xtd::byte r
Gets or sets the red component value of this xtd::drawing::helpers::argb struct.
Definition argb.hpp:32
xtd::byte b
Gets or sets the blue component value of this xtd::drawing::helpers::argb struct.
Definition argb.hpp:38
static argb from_uint32(uint32 value) noexcept
Creates a xtd::helpers::argb struct from the specified unsigned integer value.
Definition argb.hpp:47
xtd::byte a
Gets or sets the alpha component value of this xtd::drawing::helpers::argb struct.
Definition argb.hpp:29