vscodeModernDarkEditorTheme top-level property
Implementation
final EditorTheme<Color, TextStyle> vscodeModernDarkEditorTheme =
VSCodeEditorTheme.fromJson(
vscodeModernDarkJSON,
defaultTextStyle: const TextStyle(
fontFamily: 'IBMPlexMono',
color: Color(0xFFD4D4D4),
),
parseColor: (String? hexString) {
if (hexString == null) {
return null;
}
final buffer = StringBuffer();
if (hexString.length == 6 || hexString.length == 7) buffer.write('ff');
buffer.write(hexString.replaceFirst('#', ''));
try {
return Color(int.parse(buffer.toString(), radix: 16));
} catch (e) {
throw Exception('Failed to parse color: $hexString, error: $e');
}
},
colorToString: (Color? color) {
if (color == null) {
return null;
}
return '#${color.value.toRadixString(16).substring(2)}'; // Remove alpha for hex string
},
);