[NUI] Fix color format to #RRGGBBAA from #AARRGGBB (#3225)
authorJiyun Yang <ji.yang@samsung.com>
Tue, 29 Jun 2021 05:33:25 +0000 (14:33 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 29 Jun 2021 06:46:52 +0000 (15:46 +0900)
In NUI Color, the color hex format is defined as #RRGGBBAA but in xaml it is #AARRGGBB.
This can cause mess confusing to user so we decided to make them same: #RRGGBBAA

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs

index cfd1471..7150c24 100755 (executable)
@@ -129,24 +129,23 @@ namespace Tizen.NUI.Binding
 
                     return FromRgb((int)t1, (int)t2, (int)t3);
 
-                case 4: //#argb => aarrggbb
+                case 4: //#rgba => rrggbbaa
                     var f1 = ToHexD(hex[idx++]);
                     var f2 = ToHexD(hex[idx++]);
                     var f3 = ToHexD(hex[idx++]);
                     var f4 = ToHexD(hex[idx]);
-                    return FromRgba((int)f2, (int)f3, (int)f4, (int)f1);
+                    return FromRgba((int)f1, (int)f2, (int)f3, (int)f4);
 
                 case 6: //#rrggbb => ffrrggbb
                     return FromRgb((int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx++])),
                             (int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx++])),
                             (int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx])));
 
-                case 8: //#aarrggbb
-                    var a1 = ToHex(hex[idx++]) << 4 | ToHex(hex[idx++]);
+                case 8: //#rrggbbaa
                     return FromRgba((int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx++])),
                             (int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx++])),
-                            (int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx])),
-                            (int)a1);
+                            (int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx++])),
+                            (int)(ToHex(hex[idx++]) << 4 | ToHex(hex[idx])));
 
                 default: //everything else will result in unexpected results
                     return Color.Black;