{/each}
{/if}
diff --git a/frontend/src/lib/helpers.ts b/frontend/src/lib/helpers.ts
new file mode 100644
index 0000000..975662a
--- /dev/null
+++ b/frontend/src/lib/helpers.ts
@@ -0,0 +1,16 @@
+/*
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ */
+
+export const invertColor = (hexTripletColor: string): string => {
+ let color = hexTripletColor;
+ color = color.substring(1); // remove #
+ let color_int = parseInt(color, 16); // convert to integer
+ color_int = 0xffffff ^ color_int; // invert three bytes
+ color = color_int.toString(16); // convert to hex
+ color = ('000000' + color).slice(-6); // pad with leading zeros
+ color = '#' + color; // prepend #
+ return color;
+};
diff --git a/frontend/src/lib/play/question.svelte b/frontend/src/lib/play/question.svelte
index 718f803..5db06f6 100644
--- a/frontend/src/lib/play/question.svelte
+++ b/frontend/src/lib/play/question.svelte
@@ -9,6 +9,7 @@
import { socket } from '$lib/socket';
import Spinner from '../Spinner.svelte';
import { getLocalization } from '$lib/i18n';
+ import { invertColor } from '$lib/helpers';
const { t } = getLocalization();
@@ -86,7 +87,8 @@