# lv_vg_lite_grad.h (/api/draw/vg_lite/lv_vg_lite_grad_h)



<ApiSummary functions="6" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (2)&#x22;,&#x22;Other (4)&#x22;]">
  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_vg_lite_grad_ctx_get_pending" file="draw/vg_lite/lv_vg_lite_grad.h" line="52" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/vg_lite/lv_vg_lite_grad.h#L52">
      lv_vg_lite_grad_ctx_get_pending [#lv_vg_lite_grad_ctx_get_pending]

      Get the pending list of gradient items.

      ```c title=" " lineNumbers=1
      struct _lv_vg_lite_pending_t * lv_vg_lite_grad_ctx_get_pending(struct _lv_vg_lite_grad_ctx_t *ctx)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                              | Description          |
      | ----- | --------------------------------- | -------------------- |
      | `ctx` | `struct _lv_vg_lite_grad_ctx_t *` | the gradient context |
    </ApiMember>

    <ApiMember kind="function" name="lv_vg_lite_grad_ctx_get_cache" file="draw/vg_lite/lv_vg_lite_grad.h" line="58" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/vg_lite/lv_vg_lite_grad.h#L58">
      lv_vg_lite_grad_ctx_get_cache [#lv_vg_lite_grad_ctx_get_cache]

      Get the cache of gradient items.

      ```c title=" " lineNumbers=1
      struct _lv_cache_t * lv_vg_lite_grad_ctx_get_cache(struct _lv_vg_lite_grad_ctx_t *ctx)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                              | Description          |
      | ----- | --------------------------------- | -------------------- |
      | `ctx` | `struct _lv_vg_lite_grad_ctx_t *` | the gradient context |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (4)">
    <ApiMember kind="function" name="lv_vg_lite_grad_ctx_create" file="draw/vg_lite/lv_vg_lite_grad.h" line="40" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/vg_lite/lv_vg_lite_grad.h#L40">
      lv_vg_lite_grad_ctx_create [#lv_vg_lite_grad_ctx_create]

      Create a gradient context.

      ```c title=" " lineNumbers=1
      struct _lv_vg_lite_grad_ctx_t * lv_vg_lite_grad_ctx_create(uint32_t cache_cnt, struct _lv_draw_vg_lite_unit_t *unit)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                                                                  | Description             |
      | ----------- | ------------------------------------------------------------------------------------- | ----------------------- |
      | `cache_cnt` | <ApiLink name="uint32_t" />                                                           | number of cache entries |
      | `unit`      | <ApiLink name="_lv_draw_vg_lite_unit_t" display="struct _lv_draw_vg_lite_unit_t *" /> | the draw unit           |
    </ApiMember>

    <ApiMember kind="function" name="lv_vg_lite_grad_ctx_delete" file="draw/vg_lite/lv_vg_lite_grad.h" line="46" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/vg_lite/lv_vg_lite_grad.h#L46">
      lv_vg_lite_grad_ctx_delete [#lv_vg_lite_grad_ctx_delete]

      Delete a gradient context.

      ```c title=" " lineNumbers=1
      void lv_vg_lite_grad_ctx_delete(struct _lv_vg_lite_grad_ctx_t *ctx)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                              | Description                    |
      | ----- | --------------------------------- | ------------------------------ |
      | `ctx` | `struct _lv_vg_lite_grad_ctx_t *` | the gradient context to delete |
    </ApiMember>

    <ApiMember kind="function" name="lv_vg_lite_draw_grad" file="draw/vg_lite/lv_vg_lite_grad.h" line="72" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/vg_lite/lv_vg_lite_grad.h#L72">
      lv_vg_lite_draw_grad [#lv_vg_lite_draw_grad]

      Draw a gradient.

      ```c title=" " lineNumbers=1
      bool lv_vg_lite_draw_grad(struct _lv_vg_lite_grad_ctx_t *ctx, vg_lite_buffer_t *buffer, vg_lite_path_t *path, const lv_vector_gradient_t *grad, const vg_lite_matrix_t *grad_matrix, const vg_lite_matrix_t *matrix, vg_lite_fill_t fill, vg_lite_blend_t blend)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name          | Type                                                                           | Description                         |
      | ------------- | ------------------------------------------------------------------------------ | ----------------------------------- |
      | `ctx`         | `struct _lv_vg_lite_grad_ctx_t *`                                              | the gradient context                |
      | `buffer`      | `vg_lite_buffer_t *`                                                           | the target buffer                   |
      | `path`        | `vg_lite_path_t *`                                                             | the path to draw the gradient on    |
      | `grad`        | <ApiLink name="lv_vector_gradient_t" display="const lv_vector_gradient_t *" /> | the gradient descriptor             |
      | `grad_matrix` | `const vg_lite_matrix_t *`                                                     | the gradient matrix                 |
      | `matrix`      | `const vg_lite_matrix_t *`                                                     | the matrix to apply to the gradient |
      | `fill`        | `vg_lite_fill_t`                                                               | the fill rule                       |
      | `blend`       | `vg_lite_blend_t`                                                              | the blend mode                      |

      **Returns:** <ApiLink name="bool" /> — true: success, false: failed
    </ApiMember>

    <ApiMember kind="function" name="lv_vg_lite_draw_grad_helper" file="draw/vg_lite/lv_vg_lite_grad.h" line="94" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/vg_lite/lv_vg_lite_grad.h#L94">
      lv_vg_lite_draw_grad_helper [#lv_vg_lite_draw_grad_helper]

      Draw a gradient helper.

      ```c title=" " lineNumbers=1
      bool lv_vg_lite_draw_grad_helper(struct _lv_vg_lite_grad_ctx_t *ctx, vg_lite_buffer_t *buffer, vg_lite_path_t *path, const lv_area_t *area, const lv_grad_dsc_t *grad_dsc, const vg_lite_matrix_t *matrix, vg_lite_fill_t fill, vg_lite_blend_t blend)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                                             | Description                         |
      | ---------- | ---------------------------------------------------------------- | ----------------------------------- |
      | `ctx`      | `struct _lv_vg_lite_grad_ctx_t *`                                | the gradient context                |
      | `buffer`   | `vg_lite_buffer_t *`                                             | the target buffer                   |
      | `path`     | `vg_lite_path_t *`                                               | the path to draw the gradient on    |
      | `area`     | <ApiLink name="lv_area_t" display="const lv_area_t *" />         | the area to draw the gradient on    |
      | `grad_dsc` | <ApiLink name="lv_grad_dsc_t" display="const lv_grad_dsc_t *" /> | the gradient descriptor             |
      | `matrix`   | `const vg_lite_matrix_t *`                                       | the matrix to apply to the gradient |
      | `fill`     | `vg_lite_fill_t`                                                 | the fill rule                       |
      | `blend`    | `vg_lite_blend_t`                                                | the blend mode                      |

      **Returns:** <ApiLink name="bool" /> — true: success, false: failed
    </ApiMember>
  </ApiTab>
</ApiTabs>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_vg_lite_utils.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
