diff --git a/src/frontend/src/modals/templatesModal/components/TemplateCardComponent/index.tsx b/src/frontend/src/modals/templatesModal/components/TemplateCardComponent/index.tsx
index 93b5bfa2f2d4..7bb54f4b1d81 100644
--- a/src/frontend/src/modals/templatesModal/components/TemplateCardComponent/index.tsx
+++ b/src/frontend/src/modals/templatesModal/components/TemplateCardComponent/index.tsx
@@ -1,5 +1,6 @@
import { convertTestName } from "@/components/storeCardComponent/utils/convert-test-name";
-import { BG_NOISE, flowGradients } from "@/utils/styleUtils";
+import { swatchColors } from "@/utils/styleUtils";
+import { cn } from "@/utils/utils";
import IconComponent, {
ForwardedIconComponent,
} from "../../../../components/genericIconComponent";
@@ -9,10 +10,11 @@ export default function TemplateCardComponent({
example,
onClick,
}: TemplateCardComponentProps) {
- const directionIndex =
- (example.gradient && example.gradient.split(",").length == 1
- ? example.gradient.length
- : example.name.length) % flowGradients.length;
+ const swatchIndex =
+ (example.gradient && parseInt(example.gradient)
+ ? parseInt(example.gradient)
+ : (example.gradient?.length ?? example.name.length)) %
+ swatchColors.length;
const handleKeyDown = (e) => {
if (e.key === "Enter" || e.key === " ") {
@@ -21,13 +23,6 @@ export default function TemplateCardComponent({
}
};
- const bgGradient =
- BG_NOISE +
- "," +
- (example.gradient && example.gradient.split(",").length > 1
- ? "linear-gradient(90deg, " + example.gradient + ")"
- : flowGradients[directionIndex]);
-
return (
-
+
diff --git a/src/frontend/src/pages/MainPage/components/grid/index.tsx b/src/frontend/src/pages/MainPage/components/grid/index.tsx
index 84d938280357..7a6f7d5f47c9 100644
--- a/src/frontend/src/pages/MainPage/components/grid/index.tsx
+++ b/src/frontend/src/pages/MainPage/components/grid/index.tsx
@@ -14,6 +14,8 @@ import useAlertStore from "@/stores/alertStore";
import useFlowsManagerStore from "@/stores/flowsManagerStore";
import { FlowType } from "@/types/flow";
import { getInputsAndOutputs } from "@/utils/storeUtils";
+import { swatchColors } from "@/utils/styleUtils";
+import { cn } from "@/utils/utils";
import { useState } from "react";
import { useParams } from "react-router-dom";
import useDescriptionModal from "../../oldComponents/componentsComponent/hooks/use-description-modal";
@@ -99,6 +101,12 @@ const GridComponent = ({ flowData }: { flowData: FlowType }) => {
const { onDragStart } = useDragStart(flowData);
+ const swatchIndex =
+ (flowData.gradient && parseInt(flowData.gradient)
+ ? parseInt(flowData.gradient)
+ : (flowData.gradient?.length ?? flowData.name.length)) %
+ swatchColors.length;
+
return (
<>
{
}`}
>
-
+
{
const descriptionModal = useDescriptionModal([flowData?.id], "flow");
+ const swatchIndex =
+ (flowData.gradient && parseInt(flowData.gradient)
+ ? parseInt(flowData.gradient)
+ : (flowData.gradient?.length ?? flowData.name.length)) %
+ swatchColors.length;
+
return (
<>
{
>
{/* Icon */}
diff --git a/src/frontend/src/style/index.css b/src/frontend/src/style/index.css
index 1429dba85b48..f64b539c1a63 100644
--- a/src/frontend/src/style/index.css
+++ b/src/frontend/src/style/index.css
@@ -142,6 +142,14 @@
--datatype-indigo-foreground: 226.5 100% 93.9%;
--node-ring: 240 6% 90%;
+
+ --neon-fuschia: 340 100% 60%; /* hsl(340, 100%, 60%) */
+ --digital-orchid: 295 100% 75%; /* hsl(295, 100%, 75%) */
+ --plasma-purple: 262 97% 57%; /* hsl(262, 97%, 57%) */
+ --electric-blue: 248 99% 53%; /* hsl(248, 99%, 53%) */
+ --holo-frost: 186 98% 80%; /* hsl(186, 98%, 80%) */
+ --terminal-green: 129 98% 80%; /* hsl(129, 98%, 80%) */
+ --cosmic-void: 258 95% 16%; /* hsl(258, 95%, 16%) */
}
.dark {
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts
index 28df21f09bb9..732b46b71424 100644
--- a/src/frontend/src/utils/styleUtils.ts
+++ b/src/frontend/src/utils/styleUtils.ts
@@ -331,6 +331,15 @@ export const flowGradients = [
"linear-gradient(90deg, #2F10FE 0%, #98F4FE 100%)",
];
+export const swatchColors = [
+ "bg-neon-fuschia text-white",
+ "bg-digital-orchid text-plasma-purple",
+ "bg-plasma-purple text-digital-orchid",
+ "bg-electric-blue text-holo-frost",
+ "bg-holo-frost text-electric-blue",
+ "bg-terminal-green text-cosmic-void",
+];
+
export const nodeColors: { [char: string]: string } = {
inputs: "#10B981",
outputs: "#AA2411",
diff --git a/src/frontend/tailwind.config.mjs b/src/frontend/tailwind.config.mjs
index 492fbd700fc8..c8b8460069f6 100644
--- a/src/frontend/tailwind.config.mjs
+++ b/src/frontend/tailwind.config.mjs
@@ -241,6 +241,13 @@ const config = {
foreground: "hsl(var(--datatype-indigo-foreground))",
},
"node-ring": "hsl(var(--node-ring))",
+ "neon-fuschia": "hsl(var(--neon-fuschia))",
+ "digital-orchid": "hsl(var(--digital-orchid))",
+ "plasma-purple": "hsl(var(--plasma-purple))",
+ "electric-blue": "hsl(var(--electric-blue))",
+ "holo-frost": "hsl(var(--holo-frost))",
+ "terminal-green": "hsl(var(--terminal-green))",
+ "cosmic-void": "hsl(var(--cosmic-void))",
},
borderRadius: {
lg: `var(--radius)`,