Parses the input string for a color value.
The allowable values are color | inherit
Namespace: RSSVGUtils
Delphi |
function ParseColor( S: String; |
Parameters
S
Type: String
Input string to parse
DefValue
Type: System.Void
Default Value. If the string is empty, the default value is returned
Clear
Type: Boolean
Set to True if the input string is 'none'
Inherits
Type: Boolean
Set to True when the input string contains 'inherit' keyword
CurrentColor
Type: System.Void
if input string equals the 'currentColor' keyword, the function returns this value
Type: TSVGColor
If the string is blank, the function returns the default value ( DefValue). If the string contains 'inherits', the function returns the default value and sets the Inherits parameter to true. A color is either a keyword or a numerical RGB specification. The format of an RGB value in hexadecimal notation is a "#" immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display. The format of an RGB value in the functional notation is an RGB start-function followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")". An RGB start-function is the case- insensitive string "rgb(", for example "RGB(" or " rGb(". For compatibility, the all-lowercase form "rgb(" is preferred. The integer value 255 corresponds to 100%, and to F or FF in the hexadecimal notation: rgb(255,255,255) = rgb(100%, 100%,100%) = # FFF. White space characters are allowed around the numerical values. All RGB colors are specified in the sRGB color space [ SRGB]. Using sRGB provides an unambiguous and objectively measurable definition of the color, which can be related to international standards (see [COLORIMETRY]). |
Reference |