diff --git a/data/pref.xml b/data/pref.xml
index 45686b401..e2bb462c2 100644
--- a/data/pref.xml
+++ b/data/pref.xml
@@ -175,6 +175,7 @@
+
diff --git a/data/strings/en.ini b/data/strings/en.ini
index 6653ea5bf..5ce522567 100644
--- a/data/strings/en.ini
+++ b/data/strings/en.ini
@@ -1023,6 +1023,7 @@ overwrite_files_on_export_sprite_sheet_alert = Show warning when overwriting fil
gif_options_alert = Show GIF options when saving .gif files
jpeg_options_alert = Show JPEG options when saving .jpeg files
advanced_mode_alert = Show alert when we enter to Advanced Mode
+invalid_fg_bg_color_alert = Show alert when drawing with index out of palette bounds
reset_alerts = Reset all alert dialogs
available_themes = Available Themes
select_theme = &Select
diff --git a/data/widgets/options.xml b/data/widgets/options.xml
index c61a1e64f..9759f0539 100644
--- a/data/widgets/options.xml
+++ b/data/widgets/options.xml
@@ -327,6 +327,8 @@
pref="jpeg.show_alert" />
+
diff --git a/src/app/ui/editor/tool_loop_impl.cpp b/src/app/ui/editor/tool_loop_impl.cpp
index 98aa351b1..e354fbb86 100644
--- a/src/app/ui/editor/tool_loop_impl.cpp
+++ b/src/app/ui/editor/tool_loop_impl.cpp
@@ -37,6 +37,7 @@
#include "app/ui/context_bar.h"
#include "app/ui/editor/editor.h"
#include "app/ui/main_window.h"
+#include "app/ui/optional_alert.h"
#include "app/ui/status_bar.h"
#include "app/util/expand_cel_canvas.h"
#include "doc/brush.h"
@@ -599,8 +600,12 @@ tools::ToolLoop* create_tool_loop(
app::Color bg = colorbar->getBgColor();
if (!fg.isValid() || !bg.isValid()) {
- Alert::show(Strings::alerts_invalid_fg_or_bg_colors());
- return NULL;
+ if (Preferences::instance().colorBar.showInvalidFgBgColorAlert()) {
+ OptionalAlert::show(
+ Preferences::instance().colorBar.showInvalidFgBgColorAlert,
+ 1, Strings::alerts_invalid_fg_or_bg_colors());
+ return nullptr;
+ }
}
// Create the new tool loop