ArcGIS Pro 2.7 API Reference Guide
SearchColorRamps Method
Example 

ArcGIS.Desktop.Mapping Namespace > StyleHelper Class : SearchColorRamps Method
The StyleProjectItem to search.
The search term.
Returns a collection of color ramp style items that satisfy the search criteria. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

styleProjectItem
The StyleProjectItem to search.
searchString
The search term.

Return Value

A collection of ColorRampStyleItem.
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run
Example
public async Task<IList<ColorRampStyleItem>> GetColorRampsFromStyleAsync(StyleProjectItem style, string searchString)
{
  //StyleProjectItem can be "ColorBrewer Schemes (RGB)", "ArcGIS 2D"...
  if (style == null)
    throw new System.ArgumentNullException();

  //Search for color ramps
  //Color Ramp searchString can be "Spectral (7 Classes)", "Pastel 1 (3 Classes)", "Red-Gray (10 Classes)"..
  return await QueuedTask.Run(() => style.SearchColorRamps(searchString));
}
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

StyleHelper Class
StyleHelper Members