File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 55using System . Text . RegularExpressions ;
66using System . Text ;
77using AngleSharp . Dom ;
8+ using System . Globalization ;
89
910namespace AdventOfCode . Model ;
1011
@@ -97,7 +98,7 @@ public static Calendar Parse(int year, IDocument document) {
9798 foreach ( var textNode in GetText ( calendar ) ) {
9899 var text = textNode . Text ( ) ;
99100 var style = textNode . ParentElement . ComputeCurrentStyle ( ) ;
100- var rgbaColor = style [ "color" ] ;
101+ var rgbaColor = ! string . IsNullOrEmpty ( style [ "color" ] ) ? style [ "color" ] : "rgba(204,204,204,1)" ;
101102 var bold = ! string . IsNullOrEmpty ( style [ "text-shadow" ] ) ;
102103
103104 if ( style [ "position" ] == "absolute" ||
@@ -111,7 +112,7 @@ public static Calendar Parse(int year, IDocument document) {
111112
112113 var m = Regex . Match ( widthSpec , "[.0-9]+" ) ;
113114 if ( m . Success ) {
114- var width = double . Parse ( m . Value ) * 1.7 ;
115+ var width = double . Parse ( m . Value , CultureInfo . InvariantCulture ) * 1.7 ;
115116 var c = ( int ) Math . Round ( width - text . Length , MidpointRounding . AwayFromZero ) ;
116117 if ( c > 0 ) {
117118 text += new string ( ' ' , c ) ;
You can’t perform that action at this time.
0 commit comments