1#pragma once
2
3/* Generated with cbindgen:0.26.0 */
4
5#include <cstdarg>
6#include <cstdint>
7#include <cstdlib>
8#include <ostream>
9#include <new>
10#include "slint_enums_internal.h"
11
12namespace slint {
13namespace cbindgen_private {
14namespace types {
15
16/// Color represents a color in the Slint run-time, represented using 8-bit channels for
17/// red, green, blue and the alpha (opacity).
18/// It can be conveniently converted using the `to_` and `from_` (a)rgb helper functions:
19/// ```
20/// # fn do_something_with_red_and_green(_:f32, _:f32) {}
21/// # fn do_something_with_red(_:u8) {}
22/// # use i_slint_core::graphics::{Color, RgbaColor};
23/// # let some_color = Color::from_rgb_u8(0, 0, 0);
24/// let col = some_color.to_argb_f32();
25/// do_something_with_red_and_green(col.red, col.green);
26///
27/// let RgbaColor { red, blue, green, .. } = some_color.to_argb_u8();
28/// do_something_with_red(red);
29///
30/// let new_col = Color::from(RgbaColor{ red: 0.5, green: 0.65, blue: 0.32, alpha: 1.});
31/// ```
32struct Color {
33 uint8_t red;
34 uint8_t green;
35 uint8_t blue;
36 uint8_t alpha;
37
38 bool operator==(const Color& other) const {
39 return red == other.red &&
40 green == other.green &&
41 blue == other.blue &&
42 alpha == other.alpha;
43 }
44 bool operator!=(const Color& other) const {
45 return red != other.red ||
46 green != other.green ||
47 blue != other.blue ||
48 alpha != other.alpha;
49 }
50};
51
52extern "C" {
53
54void slint_color_brighter(const Color *col, float factor, Color *out);
55
56void slint_color_darker(const Color *col, float factor, Color *out);
57
58void slint_color_transparentize(const Color *col, float factor, Color *out);
59
60void slint_color_mix(const Color *col1, const Color *col2, float factor, Color *out);
61
62void slint_color_with_alpha(const Color *col, float alpha, Color *out);
63
64} // extern "C"
65
66} // namespace types
67} // namespace cbindgen_private
68} // namespace slint
69

source code of slint/target/debug/build/slint-cpp-d3acc71f258707cf/out/generated_include/slint_color_internal.h