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.
rgbValue = CRegistry:GetRgb( sName, rgbDefault ) where rgbValue is an RGB string value returned from the Registry. sName is the name of the value to fetch. rgbDefault is the default value returned if sName is not found in the Registry. |
The following script opens a key specified by sKeyName and returns an RGB string value saved under the name "MyVal":
|
-- open the key and create a CRegistry object |
|
-- fetch the value of "MyVal", default to "255,0,0" |
|
-- Result: MyVal= 255,0,0 (value did not already exist) |