Function libnotcurses_sys::ffi::ncplane_gradient[][src]

pub unsafe extern "C" fn ncplane_gradient(
    n: *mut ncplane,
    egc: *const c_char,
    stylemask: u32,
    ul: u64,
    ur: u64,
    ll: u64,
    lr: u64,
    ystop: c_int,
    xstop: c_int
) -> c_int
Expand description

Draw a gradient with its upper-left corner at the current cursor position, stopping at ‘ystop’x’xstop’. The glyph composed of ‘egc’ and ‘stylemask’ is used for all cells. The channels specified by ‘ul’, ‘ur’, ‘ll’, and ‘lr’ are composed into foreground and background gradients. To do a vertical gradient, ‘ul’ ought equal ‘ur’ and ‘ll’ ought equal ‘lr’. To do a horizontal gradient, ‘ul’ ought equal ‘ll’ and ‘ur’ ought equal ‘ul’. To color everything the same, all four channels should be equivalent. The resulting alpha values are equal to incoming alpha values. Returns the number of cells filled on success, or -1 on failure.

Palette-indexed color is not supported.

Preconditions for gradient operations (error otherwise):

all: only RGB colors, unless all four channels match as default all: all alpha values must be the same 1x1: all four colors must be the same 1xN: both top and both bottom colors must be the same (vertical gradient) Nx1: both left and both right colors must be the same (horizontal gradient)