Skip to content

Commit 1d308a9

Browse files
committed
🧹 randomize via option in gradients
1 parent 94bc2ba commit 1d308a9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/showcase/effects/gradients/CustomGradientGenerator.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ const CustomGradientGenerator = () => {
9292
setFromColor(newFromColor)
9393
setToColor(newToColor)
9494
setSelected(newDirection)
95-
setShowVia(false) // Optionally, you can set this to Math.random() > 0.5 to randomly include or exclude the via color
95+
const newShowVia = Math.random() > 0.5
96+
setShowVia(newShowVia)
97+
if (newShowVia) {
98+
const newViaColor = getRandomColor()
99+
setViaColor(newViaColor)
100+
}
96101
}
97102

98103
const variants = {

0 commit comments

Comments
 (0)