fbpx

Method CompareAverageColorName

Compares object average color to selected color

Usage

Function CompareAverageColorName( 
        String ColorName,
        Integer Precision [Optional]
)

Parameters

ColorName

Type: String

Color name to compare

Precision (optional)

Type: Integer

Default value: 85

Comparison precision

Returns

True if colors are equal relating to precision; otherwise, false

Example

VBScript

'get object average color and compare it to knowingly get result
objectAverageColor = Application("Demo").View("DemoView").Object("DemoObject").GetAverageColorName()
positiveResult = Application("Demo").View("DemoView").Object("DemoObject").CompareAverageColorName(objectAverageColor)
'get another random color which is not object average color and compare it, i.e. orange
negativeResult = Application("Demo").View("DemoView").Object("DemoObject").CompareAverageColorName("Orange")

JavaScript

// get object average color and compare it to knowingly get result
var objectAverageColor = Application("Demo").View("DemoView").Object("DemoObject").GetAverageColorName();
var positiveResult = Application("Demo").View("DemoView").Object("DemoObject").CompareAverageColorName(objectAverageColor);
// get another random color which is not object average color and compare it, i.e. orange
var negativeResult = Application("Demo").View("DemoView").Object("DemoObject").CompareAverageColorName("Orange");

Documentation Categories

ZAPTEST

FARM

LOAD

Virtual Expert

ZAPTEST

ZAPTEST Logo