Skip to main content

ColorRamp

サマリー

Allows you to reference an existing color ramp that is available to an ArcGIS project.

ディスカッション

It is essential that you author color ramps in a project with unique names because it is possible to have more than one color ramp with the same name. The index parameter does help if there are duplicate names, but you will need to manually determine and test for any redundancy.

構文

ColorRamp({color_ramp_name}, index)

パラメーター 説明 データ タイプ

color_ramp_name

The name of the color ramp as it appears in the application. The name is not case sensitive.

String

index

The index value of the color ramp given that there may be more than one color ramp with the same name.

The default value is 0.

Integer

戻り値

データ タイプ 説明

ColorRamp

Returns the ColorRamp object.

コードのサンプル

ColorRamp example

The following line of code returns a color ramp with the name "Yellow to Red".

import arcpy
cr = arcpy.mp.ColorRamp("Yellow to Red")