CRegistry:GetRgb


The GetRgb method returns an RGB value string form a registry key. The return value is in a form like "100,240,255" which contains R, G, and B color values between 0 and 255. The method also specifies a default value to be returned if the named value or key does not already exist in the Registry. You can work with the RGB string value using the CColorRef class.

Syntax

rgbValue = CRegistry:GetRgb( sName, rgbDefault )

bullet.gif    rgbValue is an RGB string value returned from the Registry.

bullet.gif    sName is the name of the value to fetch.

bullet.gif    rgbDefault is the default value returned if sName is not found in the Registry.

Example

The following script opens a key specified by sKeyName and returns an RGB string value saved under the name "MyVal":

R = CRegistry:Open( sKeyName )

-- open the key and create a CRegistry object

rgb = R:GetRgb( "MyVal", "255,0,0" )

-- fetch the value of "MyVal", default to "255,0,0"

Printf( "MyVal= %s", rgb )

-- Result: MyVal= 255,0,0 (value did not already exist)

Related Topics

CRegistry class, SetRgb, CColorRef


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.