From 0687223e9d9eb898e9269e88d6007c8f69f6aaf6 Mon Sep 17 00:00:00 2001
From: Peter Saint-Andre Added the ColorAlpha data type.
- This extension also relies on &xep0122; as a fall-back mechanism so clients not recognizing the color data type can handle it as a - string with a regular expression validating user input. + This extension also relies on &xep0122; as a fallback mechanism so clients not recognizing the color data types can handle them as + strings with a regular expressions validating user input.
The color value is represented by a string consisting of six case-insensitive hexadecimal digits. The first two represent the red component, @@ -106,6 +113,42 @@ directly by the user. However, it is still available implicitly in the xdc:Color data type.
+ The following example shows how to publish a Color Field parameter including an Alpha channel in a Data Form: +
++ The color value is represented by a string consisting of eight case-insensitive hexadecimal digits. The first two represent the red component, + the next two the green component and the last two the blue component. The last two represents the alpha channel, where 00 means completely + transparent and FF means completely opaque. +
++ As with the xdc:Color type defined above, if the client does not support XEP-0122 (Data Form Validation), it will interpret the field as a + normal text-single field. It is up to the server to validate user input. But the user can still enter a color. +
++ A client that supports XEP-0122 (Data Form Validation), but not this extension, will not understand the data type xdc:ColorAlpha. + It will thus default to a normal string (xs:string). However, the client still supports the regex validation rule, + making sure the client only allows user input that forms valid color values. +
++ A client supporting this specification will recognize the xdc:ColorAlpha data type, and choose to show a color picker dialog instead + of a string input field. In this case, the regular expression in the validation statement will not be used, as the string is not edited + directly by the user. However, it is still available implicitly in the xdc:ColorAlpha data type. +
+
@@ -116,8 +159,8 @@
+ As defined in XEP-0122 ยง7.2.2, following is the submission + to the XMPP Registrar of a new datatype representing color values with alpha channel for use in data forms: +
+
+
+ xdc:ColorAlpha
+ a color value represented as an RGBA value, expressed using 8 hexadecimal digits, with each pair of
+ the hexadecimal digits representing the values of the Red, Green, Blue and Alpha channel, respectively
basic regex
N/A
N/A
@@ -154,7 +215,16 @@
+
+
+
+
+
+
]]>
Thanks to Karin Forsell for all valuable feedback.
+