Function libnotcurses_sys::ncplane_gradient[][src]

pub fn ncplane_gradient(
    plane: &mut NcPlane,
    egc: &str,
    stylemask: NcStyle,
    ul: NcChannels,
    ur: NcChannels,
    ll: NcChannels,
    lr: NcChannels,
    y_len: NcDim,
    x_len: NcDim
) -> NcIntResult
Expand description

Draws a gradient with its upper-left corner at the current cursor position, stopping at ystop×xstop.

The glyph composed of egc and stylemask is used for all cells. The NcChannels 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)

Method: NcPlane.gradient().