WIP
This commit is contained in:
parent
a3565225ad
commit
004c5d309b
2 changed files with 223 additions and 0 deletions
222
crates/theme2/src/import.rs
Normal file
222
crates/theme2/src/import.rs
Normal file
|
@ -0,0 +1,222 @@
|
||||||
|
use crate::ThemeColorsRefinement;
|
||||||
|
|
||||||
|
struct ImportedThemeFamily {
|
||||||
|
pub id: String,
|
||||||
|
pub name: String,
|
||||||
|
pub author: String,
|
||||||
|
pub url: String,
|
||||||
|
pub license: String,
|
||||||
|
pub themes: Vec<ImportedThemeVariant>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct VSCodeColors {
|
||||||
|
terminal_background: String,
|
||||||
|
terminal_foreground: String,
|
||||||
|
terminal_ansi_bright_black: String,
|
||||||
|
terminal_ansi_bright_red: String,
|
||||||
|
terminal_ansi_bright_green: String,
|
||||||
|
terminal_ansi_bright_yellow: String,
|
||||||
|
terminal_ansi_bright_blue: String,
|
||||||
|
terminal_ansi_bright_magenta: String,
|
||||||
|
terminal_ansi_bright_cyan: String,
|
||||||
|
terminal_ansi_bright_white: String,
|
||||||
|
terminal_ansi_black: String,
|
||||||
|
terminal_ansi_red: String,
|
||||||
|
terminal_ansi_green: String,
|
||||||
|
terminal_ansi_yellow: String,
|
||||||
|
terminal_ansi_blue: String,
|
||||||
|
terminal_ansi_magenta: String,
|
||||||
|
terminal_ansi_cyan: String,
|
||||||
|
terminal_ansi_white: String,
|
||||||
|
focus_border: String,
|
||||||
|
foreground: String,
|
||||||
|
selection_background: String,
|
||||||
|
error_foreground: String,
|
||||||
|
button_background: String,
|
||||||
|
button_foreground: String,
|
||||||
|
button_secondary_background: String,
|
||||||
|
button_secondary_foreground: String,
|
||||||
|
button_secondary_hover_background: String,
|
||||||
|
dropdown_background: String,
|
||||||
|
dropdown_border: String,
|
||||||
|
dropdown_foreground: String,
|
||||||
|
input_background: String,
|
||||||
|
input_foreground: String,
|
||||||
|
input_border: String,
|
||||||
|
input_placeholder_foreground: String,
|
||||||
|
input_option_active_border: String,
|
||||||
|
input_validation_info_border: String,
|
||||||
|
input_validation_warning_border: String,
|
||||||
|
input_validation_error_border: String,
|
||||||
|
badge_foreground: String,
|
||||||
|
badge_background: String,
|
||||||
|
progress_bar_background: String,
|
||||||
|
list_active_selection_background: String,
|
||||||
|
list_active_selection_foreground: String,
|
||||||
|
list_drop_background: String,
|
||||||
|
list_focus_background: String,
|
||||||
|
list_highlight_foreground: String,
|
||||||
|
list_hover_background: String,
|
||||||
|
list_inactive_selection_background: String,
|
||||||
|
list_warning_foreground: String,
|
||||||
|
list_error_foreground: String,
|
||||||
|
activity_bar_background: String,
|
||||||
|
activity_bar_inactive_foreground: String,
|
||||||
|
activity_bar_foreground: String,
|
||||||
|
activity_bar_active_border: String,
|
||||||
|
activity_bar_active_background: String,
|
||||||
|
activity_bar_badge_background: String,
|
||||||
|
activity_bar_badge_foreground: String,
|
||||||
|
side_bar_background: String,
|
||||||
|
side_bar_title_foreground: String,
|
||||||
|
side_bar_section_header_background: String,
|
||||||
|
side_bar_section_header_border: String,
|
||||||
|
editor_group_border: String,
|
||||||
|
editor_group_drop_background: String,
|
||||||
|
editor_group_header_tabs_background: String,
|
||||||
|
tab_active_background: String,
|
||||||
|
tab_active_foreground: String,
|
||||||
|
tab_border: String,
|
||||||
|
tab_active_border_top: String,
|
||||||
|
tab_inactive_background: String,
|
||||||
|
tab_inactive_foreground: String,
|
||||||
|
editor_foreground: String,
|
||||||
|
editor_background: String,
|
||||||
|
editor_line_number_foreground: String,
|
||||||
|
editor_selection_background: String,
|
||||||
|
editor_selection_highlight_background: String,
|
||||||
|
editor_fold_background: String,
|
||||||
|
editor_word_highlight_background: String,
|
||||||
|
editor_word_highlight_strong_background: String,
|
||||||
|
editor_find_match_background: String,
|
||||||
|
editor_find_match_highlight_background: String,
|
||||||
|
editor_find_range_highlight_background: String,
|
||||||
|
editor_hover_highlight_background: String,
|
||||||
|
editor_line_highlight_border: String,
|
||||||
|
editor_link_active_foreground: String,
|
||||||
|
editor_range_highlight_background: String,
|
||||||
|
editor_snippet_tabstop_highlight_background: String,
|
||||||
|
editor_snippet_tabstop_highlight_border: String,
|
||||||
|
editor_snippet_final_tabstop_highlight_background: String,
|
||||||
|
editor_snippet_final_tabstop_highlight_border: String,
|
||||||
|
editor_whitespace_foreground: String,
|
||||||
|
editor_indent_guide_background: String,
|
||||||
|
editor_indent_guide_active_background: String,
|
||||||
|
editor_ruler_foreground: String,
|
||||||
|
editor_code_lens_foreground: String,
|
||||||
|
editor_bracket_highlight_foreground1: String,
|
||||||
|
editor_bracket_highlight_foreground2: String,
|
||||||
|
editor_bracket_highlight_foreground3: String,
|
||||||
|
editor_bracket_highlight_foreground4: String,
|
||||||
|
editor_bracket_highlight_foreground5: String,
|
||||||
|
editor_bracket_highlight_foreground6: String,
|
||||||
|
editor_bracket_highlight_unexpected_bracket_foreground: String,
|
||||||
|
editor_overview_ruler_border: String,
|
||||||
|
editor_overview_ruler_selection_highlight_foreground: String,
|
||||||
|
editor_overview_ruler_word_highlight_foreground: String,
|
||||||
|
editor_overview_ruler_word_highlight_strong_foreground: String,
|
||||||
|
editor_overview_ruler_modified_foreground: String,
|
||||||
|
editor_overview_ruler_added_foreground: String,
|
||||||
|
editor_overview_ruler_deleted_foreground: String,
|
||||||
|
editor_overview_ruler_error_foreground: String,
|
||||||
|
editor_overview_ruler_warning_foreground: String,
|
||||||
|
editor_overview_ruler_info_foreground: String,
|
||||||
|
editor_error_foreground: String,
|
||||||
|
editor_warning_foreground: String,
|
||||||
|
editor_gutter_modified_background: String,
|
||||||
|
editor_gutter_added_background: String,
|
||||||
|
editor_gutter_deleted_background: String,
|
||||||
|
git_decoration_modified_resource_foreground: String,
|
||||||
|
git_decoration_deleted_resource_foreground: String,
|
||||||
|
git_decoration_untracked_resource_foreground: String,
|
||||||
|
git_decoration_ignored_resource_foreground: String,
|
||||||
|
git_decoration_conflicting_resource_foreground: String,
|
||||||
|
diff_editor_inserted_text_background: String,
|
||||||
|
diff_editor_removed_text_background: String,
|
||||||
|
inline_chat_region_highlight: String,
|
||||||
|
editor_widget_background: String,
|
||||||
|
editor_suggest_widget_background: String,
|
||||||
|
editor_suggest_widget_foreground: String,
|
||||||
|
editor_suggest_widget_selected_background: String,
|
||||||
|
editor_hover_widget_background: String,
|
||||||
|
editor_hover_widget_border: String,
|
||||||
|
editor_marker_navigation_background: String,
|
||||||
|
peek_view_border: String,
|
||||||
|
peek_view_editor_background: String,
|
||||||
|
peek_view_editor_match_highlight_background: String,
|
||||||
|
peek_view_result_background: String,
|
||||||
|
peek_view_result_file_foreground: String,
|
||||||
|
peek_view_result_line_foreground: String,
|
||||||
|
peek_view_result_match_highlight_background: String,
|
||||||
|
peek_view_result_selection_background: String,
|
||||||
|
peek_view_result_selection_foreground: String,
|
||||||
|
peek_view_title_background: String,
|
||||||
|
peek_view_title_description_foreground: String,
|
||||||
|
peek_view_title_label_foreground: String,
|
||||||
|
merge_current_header_background: String,
|
||||||
|
merge_incoming_header_background: String,
|
||||||
|
editor_overview_ruler_current_content_foreground: String,
|
||||||
|
editor_overview_ruler_incoming_content_foreground: String,
|
||||||
|
panel_background: String,
|
||||||
|
panel_border: String,
|
||||||
|
panel_title_active_border: String,
|
||||||
|
panel_title_active_foreground: String,
|
||||||
|
panel_title_inactive_foreground: String,
|
||||||
|
status_bar_background: String,
|
||||||
|
status_bar_foreground: String,
|
||||||
|
status_bar_debugging_background: String,
|
||||||
|
status_bar_debugging_foreground: String,
|
||||||
|
status_bar_no_folder_background: String,
|
||||||
|
status_bar_no_folder_foreground: String,
|
||||||
|
status_bar_item_prominent_background: String,
|
||||||
|
status_bar_item_prominent_hover_background: String,
|
||||||
|
status_bar_item_remote_foreground: String,
|
||||||
|
status_bar_item_remote_background: String,
|
||||||
|
title_bar_active_background: String,
|
||||||
|
title_bar_active_foreground: String,
|
||||||
|
title_bar_inactive_background: String,
|
||||||
|
title_bar_inactive_foreground: String,
|
||||||
|
extension_button_prominent_foreground: String,
|
||||||
|
extension_button_prominent_background: String,
|
||||||
|
extension_button_prominent_hover_background: String,
|
||||||
|
picker_group_border: String,
|
||||||
|
picker_group_foreground: String,
|
||||||
|
debug_tool_bar_background: String,
|
||||||
|
walk_through_embedded_editor_background: String,
|
||||||
|
settings_header_foreground: String,
|
||||||
|
settings_modified_item_indicator: String,
|
||||||
|
settings_dropdown_background: String,
|
||||||
|
settings_dropdown_foreground: String,
|
||||||
|
settings_dropdown_border: String,
|
||||||
|
settings_checkbox_background: String,
|
||||||
|
settings_checkbox_foreground: String,
|
||||||
|
settings_checkbox_border: String,
|
||||||
|
settings_text_input_background: String,
|
||||||
|
settings_text_input_foreground: String,
|
||||||
|
settings_text_input_border: String,
|
||||||
|
settings_number_input_background: String,
|
||||||
|
settings_number_input_foreground: String,
|
||||||
|
settings_number_input_border: String,
|
||||||
|
breadcrumb_foreground: String,
|
||||||
|
breadcrumb_background: String,
|
||||||
|
breadcrumb_focus_foreground: String,
|
||||||
|
breadcrumb_active_selection_foreground: String,
|
||||||
|
breadcrumb_picker_background: String,
|
||||||
|
list_filter_widget_background: String,
|
||||||
|
list_filter_widget_outline: String,
|
||||||
|
list_filter_widget_no_matches_outline: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn try_vscode_colors_to_theme_colors(colors: VSCodeColors) -> ThemeColorsRefinement {
|
||||||
|
let mut theme_colors = ThemeColorsRefinement::default();
|
||||||
|
|
||||||
|
theme_colors
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vscode_colors_to_theme_colors(color: String) -> ThemeColorsRefinement {
|
||||||
|
ThemeColorsRefinement {
|
||||||
|
text: Some(color),
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
mod colors;
|
mod colors;
|
||||||
mod default_colors;
|
mod default_colors;
|
||||||
mod default_theme;
|
mod default_theme;
|
||||||
|
mod import;
|
||||||
mod registry;
|
mod registry;
|
||||||
mod scale;
|
mod scale;
|
||||||
mod settings;
|
mod settings;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue