[][src]Function clipboard_x11::alloc_color

pub fn alloc_color(
    c: &'a Connection,
    cmap: u32,
    red: u16,
    green: u16,
    blue: u16
) -> Cookie<'a, xcb_alloc_color_cookie_t>

Allocate a color

Allocates a read-only colormap entry corresponding to the closest RGB value supported by the hardware. If you are using TrueColor, you can take a shortcut and directly calculate the color pixel value to avoid the round trip. But, for example, on 16-bit color setups (VNC), you can easily get the closest supported RGB value to the RGB value you are specifying.

parameters:

  • c: The connection object to the server

  • cmap: TODO

  • red: The red value of your color.

  • green: The green value of your color.

  • blue: The blue value of your color.