color, average, compare, object, scriptless, script-less, scripted, step, view, stepview

Method CompareAverageColorName

Compares object average color to selected color

Watch this video to learn how to use this method

Have a problem with playback?

Usage

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

Step

CompareA...Name

Red

75

ColorName

Integer Precision

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");

Step

CompareA...Name

Orange

Comment

Set custom precision and save result to variable

Variable

result

CompareA...Name

Orange

90

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227