This element is an array of dictionaries. These are an available resource element that can allow an experienced user to add or modify the format of Code Snippets that are managed by WebColorPicker. The description of the use of Code Snippets above should be read and understood before reading the following documentation.
Note that Code Snippets need to be enabled at least once in the WebColorPicker user interface to trigger creation of the CodeSnippets dictionary. The dictionary should be created before additions are made, this will provide a precise template to follow in the formatting of additions to the dictionary.
Each Code Snippet format has a dictionary entry of three elements each with a defined key. To add a new Code Snipped format a new dictionary with the proper form of three elements with the required defined three keys. These are now defined.
KEY: NameSnippet - The NameSnippet key identifies a string. The string is the name that will appear in the Code popup menu on WebColorPicker's settings view. The name should be descriptive and should be unique with respect to all other Code Snippet entries.
KEY: FormatSnippet - The FormatSnippet key identifies a string. The string is a C - unix (or ObjectiveC) format string that is used as a template into which a defined list (see next key) of argument values is substituted. When WebColorPicker is running and a Code Snippet is generated this exact format string is used with the "stringWIthFormat:" Objective C function call. Complete precise documentation can be accessed from Apple's web site, a google of the function call will provide access to the documentation for those not familiar with the use of formatted strings and associated argument variables.
KEY: VarsSnippet - The VarsSnippet key identifies a string that is itself a key which will define one of a few forms of arguments that are provided as the arguments to compiled stringWithFormat statement. The possible values are tabulated and defined below.
The entries defined below are the only allowed arrangement of color arguments available. If another variation is needed please contact WebColorPicker support at WebColorPicker.com and the addition can be integrated into the next release.
rgbFixed - The arguments are 3 integers, 32 bits each. They correspond to red, green and blue components on a scale of 0 to 255. 0 being "dark", 255 associated with full saturation of the corresponding color.
rgbFloats - The arguments are 3 floating point numbers, 32 bits, not doubles. They correspond to red, green and blue components on a scale of 0.0 to 1.0. 0.0 being "dark", 1.0 associated with full saturation of the corresponding color.
rgbFixedAlphaFloat - The arguments are 3 integers, 32 bits each and one floating point number 32 bits (not double). The integers correspond to red, green and blue components on a scale of 0 to 255. 0 being "dark", 255 associated with full saturation of the corresponding color. The floating point number corresponds to the value of the alpha channel opacity value (explained above), Zero corresponds to fully transparent and 1.0 corresponds to fully opaque color.
rgbsFloats - The arguments are 4 floating point numbers, 32 bits each, not doubles. They correspond to red, green, blue, and alpha components on a scale of 0.0 to 1.0. 0.0 being "dark", 1.0 associated with full saturation of the corresponding color. For the alpha value zero corresponds to fully transparent and 1.0 corresponds to fully opaque color.
rgbPackedInt - The argument is a single integer of 32 bits. The rgb values on a scale of 0 to 255 are packed into the low order 6 hex digits. Red component stored in bits 23 through 16, green in bits 15 through 8, blue in bits 7 through 0.
rgbaPackedInt - The argument is a single integer of 32 bits containing red, green, blue, and alpha channel information. The rgb values on a scale of 0 to 255 are packed into the least significant 6 hex digits. Red component stored in bits 23 through 16, green in bits 15 through 8, blue in bits 7 through 0. The Alpha channel value is stored in bits 31 through 24. Values are naturally unsigned. This is the format used in the Java language Color(...) function call.
|