### Method

# Gimp Gradient get_custom_samples

since: 2.2

#### Declaration [src]

    gboolean
    gimp_gradient_get_custom_samples (
      GimpGradient* gradient,
      gint num_samples,
      const gdouble* positions,
      gboolean reverse,
      gint* num_color_samples,
      gdouble** color_samples
    )

#### Description [src]

Sample the gradient in custom positions.

Samples the color of the gradient at positions from a list. The left endpoint of the gradient corresponds to position 0.0, and the right endpoint corresponds to 1.0. Returns a list of floating-point values, four for each sample (RGBA.)

Available since: 2.2

#### Parameters

`num_samples`

  Type: `gint`

  The number of samples to take.

`positions`

  Type: An array of `double`

  The list of positions to sample along the gradient.

  The length of the array is specified in the `num_samples` argument.
  The data is owned by the caller of the method.

`reverse`

  Type: `gboolean`

  Use the reverse gradient.

`num_color_samples`

  Type: `gint*`

  Length of the color_samples array (4 * num_samples).

  The argument will be set by the function.

`color_samples`

  Type: An array of `double`

  Color samples: { R1, G1, B1, A1, …, Rn, Gn, Bn, An }.

  The argument will be set by the function.
  The length of the array is specified in the `num_color_samples` argument.
  The caller of the method takes ownership of the data, and is responsible for freeing it.

#### Return value

Type: `gboolean`

TRUE on success.