File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -147,18 +147,23 @@ public static Color ParseHexColor(string value)
147
147
int start = 0 ;
148
148
if ( value [ start ] == '#' ) start ++ ;
149
149
150
- uint u = Convert . ToUInt32 ( value . Substring ( start ) , 16 ) ;
150
+ ulong u ;
151
151
if ( value . Length <= 4 )
152
152
{
153
+ uint @int = Convert . ToUInt32 ( value . Substring ( start ) , 16 ) ;
153
154
uint newval = 0 ;
154
- newval |= ( u & 0x000f00 ) << 12 ;
155
- newval |= ( u & 0x000f00 ) << 8 ;
156
- newval |= ( u & 0x0000f0 ) << 8 ;
157
- newval |= ( u & 0x0000f0 ) << 4 ;
158
- newval |= ( u & 0x00000f ) << 4 ;
159
- newval |= ( u & 0x00000f ) ;
155
+ newval |= ( @int & 0x000f00 ) << 12 ;
156
+ newval |= ( @int & 0x000f00 ) << 8 ;
157
+ newval |= ( @int & 0x0000f0 ) << 8 ;
158
+ newval |= ( @int & 0x0000f0 ) << 4 ;
159
+ newval |= ( @int & 0x00000f ) << 4 ;
160
+ newval |= ( @int & 0x00000f ) ;
160
161
u = newval ;
161
162
}
163
+ else {
164
+ u = Convert . ToUInt64 ( value . Substring ( start ) , 16 ) ;
165
+ }
166
+
162
167
byte a = ( byte ) ( ( u & 0xff000000 ) >> 24 ) ;
163
168
byte r = ( byte ) ( ( u & 0x00ff0000 ) >> 16 ) ;
164
169
byte g = ( byte ) ( ( u & 0x0000ff00 ) >> 8 ) ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public TextStyle(Shape owner)
54
54
55
55
public Typeface GetTypeface ( )
56
56
{
57
- var fontFamily = _fontResolver . ResolveFontFamily ( FontFamily ) ;
57
+ var fontFamily = _fontResolver . ResolveFontFamily ( FontFamily ) ?? new FontFamily ( _defaults . FontFamily ) ;
58
58
return new Typeface ( fontFamily ,
59
59
Fontstyle ,
60
60
Fontweight ,
You can’t perform that action at this time.
0 commit comments