mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-08 20:19:04 +03:00
added more editor color keys
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
namespace clrsync::core
|
||||
{
|
||||
|
||||
const std::string GIT_SEMVER = "1.0.5+git.g2d015c6";
|
||||
const std::string GIT_SEMVER = "1.1.1+git.g3277873";
|
||||
|
||||
const std::string version_string();
|
||||
} // namespace clrsync::core
|
||||
|
||||
@@ -39,22 +39,72 @@ constexpr const char *COLOR_KEYS[] = {
|
||||
"on_warning",
|
||||
"on_error",
|
||||
|
||||
// Editor
|
||||
// Editor - Basic
|
||||
"editor_background",
|
||||
"editor_command",
|
||||
"editor_comment",
|
||||
"editor_disabled",
|
||||
"editor_emphasis",
|
||||
"editor_error",
|
||||
"editor_inactive",
|
||||
"editor_line_number",
|
||||
"editor_link",
|
||||
"editor_main",
|
||||
"editor_selected",
|
||||
"editor_foreground",
|
||||
"editor_line_highlight",
|
||||
"editor_selection",
|
||||
"editor_selection_inactive",
|
||||
"editor_cursor",
|
||||
"editor_whitespace",
|
||||
|
||||
// Editor - Gutter
|
||||
"editor_gutter_background",
|
||||
"editor_gutter_foreground",
|
||||
"editor_line_number",
|
||||
"editor_line_number_active",
|
||||
|
||||
// Editor - Syntax
|
||||
"editor_comment",
|
||||
"editor_string",
|
||||
"editor_success",
|
||||
"editor_number",
|
||||
"editor_boolean",
|
||||
"editor_keyword",
|
||||
"editor_operator",
|
||||
"editor_function",
|
||||
"editor_variable",
|
||||
"editor_parameter",
|
||||
"editor_property",
|
||||
"editor_constant",
|
||||
"editor_type",
|
||||
"editor_class",
|
||||
"editor_interface",
|
||||
"editor_enum",
|
||||
"editor_namespace",
|
||||
"editor_attribute",
|
||||
"editor_decorator",
|
||||
"editor_tag",
|
||||
"editor_punctuation",
|
||||
"editor_link",
|
||||
"editor_regex",
|
||||
"editor_escape_character",
|
||||
|
||||
// Editor - Diagnostics
|
||||
"editor_invalid",
|
||||
"editor_error",
|
||||
"editor_error_background",
|
||||
"editor_warning",
|
||||
"editor_warning_background",
|
||||
"editor_info",
|
||||
"editor_info_background",
|
||||
"editor_hint",
|
||||
"editor_hint_background",
|
||||
|
||||
// Editor - UI Elements
|
||||
"editor_active_line_border",
|
||||
"editor_indent_guide",
|
||||
"editor_indent_guide_active",
|
||||
"editor_bracket_match",
|
||||
"editor_search_match",
|
||||
"editor_search_match_active",
|
||||
"editor_find_range_highlight",
|
||||
|
||||
// Editor - Diff
|
||||
"editor_deleted",
|
||||
"editor_inserted",
|
||||
"editor_modified",
|
||||
"editor_ignored",
|
||||
"editor_folded_background",
|
||||
|
||||
// Terminal
|
||||
"base00",
|
||||
@@ -106,21 +156,72 @@ inline const std::unordered_map<std::string, uint32_t> DEFAULT_COLORS = {
|
||||
{"on_warning", 0xd2d2d2ff},
|
||||
{"on_error", 0xd2d2d2ff},
|
||||
|
||||
// Editor - Basic
|
||||
{"editor_background", 0x111111ff},
|
||||
{"editor_command", 0x3a898cff},
|
||||
{"editor_comment", 0x849899ff},
|
||||
{"editor_disabled", 0x849899ff},
|
||||
{"editor_emphasis", 0xa9dc86ff},
|
||||
{"editor_error", 0xaa4e4aff},
|
||||
{"editor_inactive", 0x849899ff},
|
||||
{"editor_line_number", 0x849899ff},
|
||||
{"editor_link", 0xb0779eff},
|
||||
{"editor_main", 0xd2d2d2ff},
|
||||
{"editor_selected", 0x242424ff},
|
||||
{"editor_foreground", 0xd2d2d2ff},
|
||||
{"editor_line_highlight", 0x191919ff},
|
||||
{"editor_selection", 0x242424ff},
|
||||
{"editor_selection_inactive", 0x1d1c1cff},
|
||||
{"editor_cursor", 0xd2d2d2ff},
|
||||
{"editor_whitespace", 0x3a3a3aff},
|
||||
|
||||
// Editor - Gutter
|
||||
{"editor_gutter_background", 0x111111ff},
|
||||
{"editor_gutter_foreground", 0x849899ff},
|
||||
{"editor_line_number", 0x849899ff},
|
||||
{"editor_line_number_active", 0xd2d2d2ff},
|
||||
|
||||
// Editor - Syntax
|
||||
{"editor_comment", 0x849899ff},
|
||||
{"editor_string", 0x9a8652ff},
|
||||
{"editor_success", 0x668a51ff},
|
||||
{"editor_number", 0xb47837ff},
|
||||
{"editor_boolean", 0xb47837ff},
|
||||
{"editor_keyword", 0x3a898cff},
|
||||
{"editor_operator", 0xd2d2d2ff},
|
||||
{"editor_function", 0xa9dc86ff},
|
||||
{"editor_variable", 0xd2d2d2ff},
|
||||
{"editor_parameter", 0xb0779eff},
|
||||
{"editor_property", 0x9a8652ff},
|
||||
{"editor_constant", 0xb47837ff},
|
||||
{"editor_type", 0x3a898cff},
|
||||
{"editor_class", 0x3a898cff},
|
||||
{"editor_interface", 0x3a898cff},
|
||||
{"editor_enum", 0x3a898cff},
|
||||
{"editor_namespace", 0xb0779eff},
|
||||
{"editor_attribute", 0xa9dc86ff},
|
||||
{"editor_decorator", 0xa9dc86ff},
|
||||
{"editor_tag", 0xaa4e4aff},
|
||||
{"editor_punctuation", 0xd2d2d2ff},
|
||||
{"editor_link", 0xb0779eff},
|
||||
{"editor_regex", 0xaa477bff},
|
||||
{"editor_escape_character", 0xb47837ff},
|
||||
|
||||
// Editor - Diagnostics
|
||||
{"editor_invalid", 0xaa4e4aff},
|
||||
{"editor_error", 0xaa4e4aff},
|
||||
{"editor_error_background", 0x3a1a1aff},
|
||||
{"editor_warning", 0xb47837ff},
|
||||
{"editor_warning_background", 0x3a2a1aff},
|
||||
{"editor_info", 0x3a898cff},
|
||||
{"editor_info_background", 0x1a2a3aff},
|
||||
{"editor_hint", 0x668a51ff},
|
||||
{"editor_hint_background", 0x1a2a1aff},
|
||||
|
||||
// Editor - UI Elements
|
||||
{"editor_active_line_border", 0x2e2e2eff},
|
||||
{"editor_indent_guide", 0x2a2a2aff},
|
||||
{"editor_indent_guide_active", 0x3a3a3aff},
|
||||
{"editor_bracket_match", 0x3a898cff},
|
||||
{"editor_search_match", 0x9a865280},
|
||||
{"editor_search_match_active", 0x9a8652ff},
|
||||
{"editor_find_range_highlight", 0x9a865240},
|
||||
|
||||
// Editor - Diff
|
||||
{"editor_deleted", 0xaa4e4aff},
|
||||
{"editor_inserted", 0x668a51ff},
|
||||
{"editor_modified", 0x9a8652ff},
|
||||
{"editor_ignored", 0x849899ff},
|
||||
{"editor_folded_background", 0x191919ff},
|
||||
|
||||
{"base00", 0x111111ff},
|
||||
{"base01", 0x668a51ff},
|
||||
|
||||
@@ -159,21 +159,72 @@ palette hellwal_generator::generate_from_image(const std::string &image_path, co
|
||||
pal.set_color("on_surface_variant", get_color_by_index(7));
|
||||
pal.set_color("on_background", get_color_by_index(7));
|
||||
|
||||
// Editor - Basic
|
||||
pal.set_color("editor_background", get_color_by_index(0));
|
||||
pal.set_color("editor_main", get_color_by_index(7));
|
||||
pal.set_color("editor_comment", get_color_by_index(8));
|
||||
pal.set_color("editor_disabled", get_color_by_index(8));
|
||||
pal.set_color("editor_inactive", get_color_by_index(8));
|
||||
pal.set_color("editor_string", get_color_by_index(2));
|
||||
pal.set_color("editor_command", get_color_by_index(5));
|
||||
pal.set_color("editor_emphasis", get_color_by_index(11));
|
||||
pal.set_color("editor_link", get_color_by_index(4));
|
||||
pal.set_color("editor_line_number", get_color_by_index(8));
|
||||
pal.set_color("editor_selected", get_color_by_index(8));
|
||||
pal.set_color("editor_foreground", get_color_by_index(7));
|
||||
pal.set_color("editor_line_highlight", get_color_by_index(8));
|
||||
pal.set_color("editor_selection", get_color_by_index(8));
|
||||
pal.set_color("editor_selection_inactive", get_color_by_index(8));
|
||||
pal.set_color("editor_cursor", get_color_by_index(7));
|
||||
pal.set_color("editor_whitespace", get_color_by_index(8));
|
||||
|
||||
// Editor - Gutter
|
||||
pal.set_color("editor_gutter_background", get_color_by_index(0));
|
||||
pal.set_color("editor_gutter_foreground", get_color_by_index(8));
|
||||
pal.set_color("editor_line_number", get_color_by_index(8));
|
||||
pal.set_color("editor_line_number_active", get_color_by_index(7));
|
||||
|
||||
// Editor - Syntax
|
||||
pal.set_color("editor_comment", get_color_by_index(8));
|
||||
pal.set_color("editor_string", get_color_by_index(2));
|
||||
pal.set_color("editor_number", get_color_by_index(3));
|
||||
pal.set_color("editor_boolean", get_color_by_index(3));
|
||||
pal.set_color("editor_keyword", get_color_by_index(5));
|
||||
pal.set_color("editor_operator", get_color_by_index(7));
|
||||
pal.set_color("editor_function", get_color_by_index(11));
|
||||
pal.set_color("editor_variable", get_color_by_index(7));
|
||||
pal.set_color("editor_parameter", get_color_by_index(4));
|
||||
pal.set_color("editor_property", get_color_by_index(2));
|
||||
pal.set_color("editor_constant", get_color_by_index(3));
|
||||
pal.set_color("editor_type", get_color_by_index(6));
|
||||
pal.set_color("editor_class", get_color_by_index(6));
|
||||
pal.set_color("editor_interface", get_color_by_index(6));
|
||||
pal.set_color("editor_enum", get_color_by_index(6));
|
||||
pal.set_color("editor_namespace", get_color_by_index(4));
|
||||
pal.set_color("editor_attribute", get_color_by_index(11));
|
||||
pal.set_color("editor_decorator", get_color_by_index(11));
|
||||
pal.set_color("editor_tag", get_color_by_index(1));
|
||||
pal.set_color("editor_punctuation", get_color_by_index(7));
|
||||
pal.set_color("editor_link", get_color_by_index(4));
|
||||
pal.set_color("editor_regex", get_color_by_index(5));
|
||||
pal.set_color("editor_escape_character", get_color_by_index(3));
|
||||
|
||||
// Editor - Diagnostics
|
||||
pal.set_color("editor_invalid", get_color_by_index(1));
|
||||
pal.set_color("editor_error", get_color_by_index(1));
|
||||
pal.set_color("editor_error_background", get_color_by_index(0));
|
||||
pal.set_color("editor_warning", get_color_by_index(3));
|
||||
pal.set_color("editor_success", get_color_by_index(2));
|
||||
pal.set_color("editor_warning_background", get_color_by_index(0));
|
||||
pal.set_color("editor_info", get_color_by_index(4));
|
||||
pal.set_color("editor_info_background", get_color_by_index(0));
|
||||
pal.set_color("editor_hint", get_color_by_index(2));
|
||||
pal.set_color("editor_hint_background", get_color_by_index(0));
|
||||
|
||||
// Editor - UI Elements
|
||||
pal.set_color("editor_active_line_border", get_color_by_index(8));
|
||||
pal.set_color("editor_indent_guide", get_color_by_index(8));
|
||||
pal.set_color("editor_indent_guide_active", get_color_by_index(7));
|
||||
pal.set_color("editor_bracket_match", get_color_by_index(6));
|
||||
pal.set_color("editor_search_match", get_color_by_index(3));
|
||||
pal.set_color("editor_search_match_active", get_color_by_index(3));
|
||||
pal.set_color("editor_find_range_highlight", get_color_by_index(3));
|
||||
|
||||
// Editor - Diff
|
||||
pal.set_color("editor_deleted", get_color_by_index(1));
|
||||
pal.set_color("editor_inserted", get_color_by_index(2));
|
||||
pal.set_color("editor_modified", get_color_by_index(3));
|
||||
pal.set_color("editor_ignored", get_color_by_index(8));
|
||||
pal.set_color("editor_folded_background", get_color_by_index(8));
|
||||
|
||||
return pal;
|
||||
}
|
||||
|
||||
@@ -105,21 +105,72 @@ static palette parse_matugen_output(const std::string &out, const matugen_genera
|
||||
{"error", "error"},
|
||||
{"on_error", "on_error"},
|
||||
|
||||
// Editor - Basic
|
||||
{"editor_background", "background"},
|
||||
{"editor_main", "on_surface"},
|
||||
{"editor_foreground", "on_surface"},
|
||||
{"editor_line_highlight", "surface_container"},
|
||||
{"editor_selection", "primary_container"},
|
||||
{"editor_selection_inactive", "surface_container_low"},
|
||||
{"editor_cursor", "on_surface"},
|
||||
{"editor_whitespace", "outline_variant"},
|
||||
|
||||
// Editor - Gutter
|
||||
{"editor_gutter_background", "background"},
|
||||
{"editor_gutter_foreground", "outline"},
|
||||
{"editor_line_number", "outline"},
|
||||
{"editor_line_number_active", "on_surface"},
|
||||
|
||||
// Editor - Syntax
|
||||
{"editor_comment", "outline"},
|
||||
{"editor_string", "tertiary"},
|
||||
{"editor_emphasis", "primary"},
|
||||
{"editor_command", "secondary"},
|
||||
{"editor_number", "secondary"},
|
||||
{"editor_boolean", "secondary"},
|
||||
{"editor_keyword", "primary"},
|
||||
{"editor_operator", "on_surface"},
|
||||
{"editor_function", "tertiary_container"},
|
||||
{"editor_variable", "on_surface"},
|
||||
{"editor_parameter", "tertiary"},
|
||||
{"editor_property", "tertiary"},
|
||||
{"editor_constant", "secondary"},
|
||||
{"editor_type", "primary"},
|
||||
{"editor_class", "primary"},
|
||||
{"editor_interface", "primary"},
|
||||
{"editor_enum", "primary"},
|
||||
{"editor_namespace", "primary_container"},
|
||||
{"editor_attribute", "tertiary_container"},
|
||||
{"editor_decorator", "tertiary_container"},
|
||||
{"editor_tag", "error"},
|
||||
{"editor_punctuation", "on_surface"},
|
||||
{"editor_link", "primary_container"},
|
||||
{"editor_regex", "secondary_container"},
|
||||
{"editor_escape_character", "secondary"},
|
||||
|
||||
// Editor - Diagnostics
|
||||
{"editor_invalid", "error"},
|
||||
{"editor_error", "error"},
|
||||
{"editor_error_background", "error_container"},
|
||||
{"editor_warning", "secondary"},
|
||||
{"editor_success", "primary"},
|
||||
{"editor_disabled", "outline_variant"},
|
||||
{"editor_inactive", "outline_variant"},
|
||||
{"editor_line_number", "outline"},
|
||||
{"editor_selected", "primary_container"},
|
||||
{"editor_selection_inactive", "surface_container_low"},
|
||||
{"editor_warning_background", "secondary_container"},
|
||||
{"editor_info", "tertiary"},
|
||||
{"editor_info_background", "tertiary_container"},
|
||||
{"editor_hint", "primary"},
|
||||
{"editor_hint_background", "primary_container"},
|
||||
|
||||
// Editor - UI Elements
|
||||
{"editor_active_line_border", "outline_variant"},
|
||||
{"editor_indent_guide", "outline_variant"},
|
||||
{"editor_indent_guide_active", "outline"},
|
||||
{"editor_bracket_match", "primary"},
|
||||
{"editor_search_match", "tertiary_container"},
|
||||
{"editor_search_match_active", "tertiary"},
|
||||
{"editor_find_range_highlight", "tertiary_container"},
|
||||
|
||||
// Editor - Diff
|
||||
{"editor_deleted", "error"},
|
||||
{"editor_inserted", "primary"},
|
||||
{"editor_modified", "secondary"},
|
||||
{"editor_ignored", "outline_variant"},
|
||||
{"editor_folded_background", "surface_container"},
|
||||
|
||||
{"base00", "background"},
|
||||
{"base01", "surface_container_lowest"},
|
||||
|
||||
@@ -15,32 +15,38 @@ void apply_to_editor(TextEditor &editor, const clrsync::core::palette ¤t)
|
||||
|
||||
auto palette = editor.GetPalette();
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Default)] = get_color_u32("editor_main");
|
||||
palette[int(TextEditor::PaletteIndex::Keyword)] = get_color_u32("editor_command");
|
||||
palette[int(TextEditor::PaletteIndex::Number)] = get_color_u32("editor_warning");
|
||||
// Basic syntax
|
||||
palette[int(TextEditor::PaletteIndex::Default)] = get_color_u32("editor_foreground");
|
||||
palette[int(TextEditor::PaletteIndex::Keyword)] = get_color_u32("editor_keyword");
|
||||
palette[int(TextEditor::PaletteIndex::Number)] = get_color_u32("editor_number");
|
||||
palette[int(TextEditor::PaletteIndex::String)] = get_color_u32("editor_string");
|
||||
palette[int(TextEditor::PaletteIndex::CharLiteral)] = get_color_u32("editor_string");
|
||||
palette[int(TextEditor::PaletteIndex::Punctuation)] = get_color_u32("editor_main");
|
||||
palette[int(TextEditor::PaletteIndex::Preprocessor)] = get_color_u32("editor_emphasis");
|
||||
palette[int(TextEditor::PaletteIndex::Identifier)] = get_color_u32("editor_main");
|
||||
palette[int(TextEditor::PaletteIndex::KnownIdentifier)] = get_color_u32("editor_link");
|
||||
palette[int(TextEditor::PaletteIndex::PreprocIdentifier)] = get_color_u32("editor_link");
|
||||
palette[int(TextEditor::PaletteIndex::Punctuation)] = get_color_u32("editor_punctuation");
|
||||
palette[int(TextEditor::PaletteIndex::Preprocessor)] = get_color_u32("editor_attribute");
|
||||
palette[int(TextEditor::PaletteIndex::Identifier)] = get_color_u32("editor_variable");
|
||||
palette[int(TextEditor::PaletteIndex::KnownIdentifier)] = get_color_u32("editor_function");
|
||||
palette[int(TextEditor::PaletteIndex::PreprocIdentifier)] = get_color_u32("editor_constant");
|
||||
|
||||
// Comments
|
||||
palette[int(TextEditor::PaletteIndex::Comment)] = get_color_u32("editor_comment");
|
||||
palette[int(TextEditor::PaletteIndex::MultiLineComment)] = get_color_u32("editor_comment");
|
||||
|
||||
// Background and cursor
|
||||
palette[int(TextEditor::PaletteIndex::Background)] = get_color_u32("editor_background");
|
||||
palette[int(TextEditor::PaletteIndex::Cursor)] = get_color_u32("cursor");
|
||||
palette[int(TextEditor::PaletteIndex::Cursor)] = get_color_u32("editor_cursor");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Selection)] = get_color_u32("editor_selected");
|
||||
palette[int(TextEditor::PaletteIndex::ErrorMarker)] = get_color_u32("editor_error");
|
||||
// Selection
|
||||
palette[int(TextEditor::PaletteIndex::Selection)] = get_color_u32("editor_selection");
|
||||
palette[int(TextEditor::PaletteIndex::ErrorMarker)] = get_color_u32("editor_error_background");
|
||||
palette[int(TextEditor::PaletteIndex::Breakpoint)] = get_color_u32("editor_error");
|
||||
|
||||
// Line numbers
|
||||
palette[int(TextEditor::PaletteIndex::LineNumber)] = get_color_u32("editor_line_number");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFill)] = get_color_u32("surface_variant");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFillInactive)] = get_color_u32("surface");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineEdge)] = get_color_u32("border_focused");
|
||||
// Current line highlight
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFill)] = get_color_u32("editor_line_highlight");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFillInactive)] = get_color_u32("editor_folded_background");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineEdge)] = get_color_u32("editor_active_line_border");
|
||||
|
||||
editor.SetPalette(palette);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user