mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 04:29:04 +03:00
fix: handle missing files
This commit is contained in:
@@ -28,14 +28,9 @@ void palette_controller::select_palette(const std::string& name)
|
||||
|
||||
void palette_controller::create_palette(const std::string& name)
|
||||
{
|
||||
clrsync::core::palette new_palette = m_current_palette;
|
||||
clrsync::core::palette new_palette = m_palette_manager.load_palette_from_file(std::string(CLRSYNC_DATADIR) + "/palettes/cursed.toml");
|
||||
new_palette.set_name(name);
|
||||
|
||||
auto colors = m_current_palette.colors();
|
||||
for (auto& pair : colors) {
|
||||
new_palette.set_color(pair.first, pair.second);
|
||||
}
|
||||
|
||||
|
||||
auto dir = clrsync::core::config::instance().palettes_path();
|
||||
m_palette_manager.save_palette_to_file(new_palette, dir);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user