ColorScale module

class ColorScale.ColorScale

Bases: SpireObject

Represents a color scale conditional formatting rule in an Excel worksheet.

This class provides properties and methods for configuring color scale conditional formatting, which changes the color of a cell based on its value relative to other values in the selected range. It allows for defining color gradients with minimum, midpoint, and maximum values and colors.

AddCriteria

Adds a color condition value to the color scale.

This method adds a predefined color condition value to the color scale, which includes a condition type, value, and color.

Parameters:

item (ColorConditionValue) – The color condition value to add.

property MaxColor: Color

Get or set the max value object’s corresponding color.

property MaxValue: IConditionValue

Get or set this ColorScale’s max value object.

property MidColor: Color

Get or set the mid value object’s corresponding color.

property MidValue: IConditionValue

Get or set this ColorScale’s mid value object.

property MinColor: Color

Get or set the min value object’s corresponding color.

property MinValue: IConditionValue

Get or set this ColorScale’s min value object.

SetConditionCount(count: int)

Sets number of objects in the collection.

Parameters:

count