Added keyword3 for color schemes. Some minor improvements in color schemes and syntax definitions.

This commit is contained in:
Martín Lucas Golini
2023-04-05 15:50:50 -03:00
parent 7425b77f9e
commit 2d3661e1b9
6 changed files with 30 additions and 9 deletions

View File

@@ -31,6 +31,7 @@ symbol = #e1e1e6
comment = #cd8b00
keyword = #ff79c6,shadow
keyword2 = #8be9fd,shadow
keyword3 = #feb86c
number = #ffd24a
literal = #f1fa8c,shadow
string = #ffcd8b
@@ -132,11 +133,12 @@ normal = #f8f8f2
symbol = #f8f8f2
comment = #6272a4
keyword = #ff79c6
keyword2 = #ff79c6
keyword2 = #8be9fd
keyword3 = #ffb86c
number = #bd93f9
literal = #f1fa8c
string = #f1fa8c
operator = #ff79c6
operator = #bd93f9
function = #50fa7b
[gruvbox dark]

View File

@@ -34,6 +34,12 @@ background=#000000
cursor=#ffffff
palette=#000000;#cc0000;#4e9a06;#c4a000;#3465a4;#75507b;#06989a;#d3d7cf;#555753;#ef2929;#8ae234;#fce94f;#729fcf;#ad7fa8;#34e2e2;#eeeeec
[Dracula]
foreground=#f8f8f2
background=#282a36
cursor=#bbbbbb
palette=#000000;#ff5555;#50fa7b;#f1fa8c;#bd93f9;#ff79c6;#8be9fd;#bbbbbb;#555555;#ff5555;#50fa7b;#f1fa8c;#bd93f9;#ff79c6;#8be9fd;#ffffff
[Github]
foreground=#3e3e3e
background=#f4f4f4

View File

@@ -894,11 +894,20 @@ Glyph FontTrueType::loadGlyph( Uint32 index, unsigned int characterSize, bool bo
Uint8* current = pixelPtr;
Uint8* end = current + bufferSize;
while ( current != end ) {
( *current++ ) = 255;
( *current++ ) = 255;
( *current++ ) = 255;
( *current++ ) = 0;
if ( bitmap.pixel_mode == FT_PIXEL_MODE_LCD ) {
while ( current != end ) {
( *current++ ) = 0;
( *current++ ) = 0;
( *current++ ) = 0;
( *current++ ) = 0;
}
} else {
while ( current != end ) {
( *current++ ) = 255;
( *current++ ) = 255;
( *current++ ) = 255;
( *current++ ) = 0;
}
}
// Extract the glyph's pixels from the bitmap

View File

@@ -43,6 +43,7 @@ SyntaxColorScheme SyntaxColorScheme::getDefault() {
{ "comment", Color( "#cd8b00" ) },
{ "keyword", { Color( "#ff79c6" ), Color::Transparent, Text::Shadow } },
{ "keyword2", { Color( "#8be9fd" ), Color::Transparent, Text::Shadow } },
{ "keyword3", { Color( "#ffb86c" ), Color::Transparent, Text::Shadow } },
{ "number", Color( "#ffd24a" ) },
{ "literal", { Color( "#f1fa8c" ), Color::Transparent, Text::Shadow } },
{ "string", Color( "#ffcd8b" ) },
@@ -202,6 +203,8 @@ const SyntaxColorScheme::Style& SyntaxColorScheme::getSyntaxStyle( const std::st
auto it = mSyntaxColors.find( type );
if ( it != mSyntaxColors.end() )
return it->second;
else if ( type == "keyword3" )
return getSyntaxStyle( "symbol" );
else if ( type == "link" || type == "link_hover" )
return getSyntaxStyle( "function" );
else {

View File

@@ -441,7 +441,7 @@ static void addJavaScript() {
{
{ { "//.-\n" }, "comment" },
{ { "/%*", "%*/" }, "comment" },
{ { "/%g", "/", "\\" }, "string" },
{ { "/[%+%-%*%^%!%=%&%|%?%:%;%,%(%[%{%<%>%\\]", "/[igm]?", "\\" }, "string" },
{ { "\"", "\"", "\\" }, "string" },
{ { "'", "'", "\\" }, "string" },
{ { "`", "`", "\\" }, "string" },
@@ -508,7 +508,7 @@ static void addTypeScript() {
{
{ { "//.-\n" }, "comment" },
{ { "/%*", "%*/" }, "comment" },
{ { "/%g", "/", "\\" }, "string" },
{ { "/[%+%-%*%^%!%=%&%|%?%:%;%,%(%[%{%<%>%\\]", "/[igm]?", "\\" }, "string" },
{ { "\"", "\"", "\\" }, "string" },
{ { "'", "'", "\\" }, "string" },
{ { "`", "`", "\\" }, "string" },

View File

@@ -176,6 +176,7 @@ static std::string semanticTokenTypeToSyntaxType( const std::string& type,
case SemanticTokenTypes::TypeParameter:
return "keyword2";
case SemanticTokenTypes::Parameter:
return "keyword3";
case SemanticTokenTypes::Variable:
return "symbol";
case SemanticTokenTypes::Property: