1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::translate::*;

glib::wrapper! {
    /// A [`Color`][crate::Color] describes a RGB color. Color components
    /// are values between 0 and 65535
    pub struct Color(BoxedInline<ffi::PopplerColor>);

    match fn {
        copy => |ptr| ffi::poppler_color_copy(mut_override(ptr)),
        free => |ptr| ffi::poppler_color_free(ptr),
        type_ => || ffi::poppler_color_get_type(),
    }
}

impl Color {
    /// Creates a new [`Color`][crate::Color]
    ///
    /// # Returns
    ///
    /// a new [`Color`][crate::Color], use `poppler_color_free()` to free it
    #[doc(alias = "poppler_color_new")]
    pub fn new() -> Color {
        unsafe { from_glib_full(ffi::poppler_color_new()) }
    }
}

impl Default for Color {
    fn default() -> Self {
        Self::new()
    }
}