fix this please every time I run it it's generating random themes sure but I keep seeing the same ones pop up a lot so it feels not so random, if you need any more fo the script say so before proceeding

private void GenerateRandomTheme(bool reapply = false)
{
    if (!reapply || _lastMainStart == Color.Empty)
    {
        var styles = Enum.GetValues(typeof(ThemeStyle)).Cast<ThemeStyle>().ToArray();
        var style = styles[_rand.Next(styles.Length)];

        switch (style)
        {
            case ThemeStyle.Dreamscape:
                {
                    // Shifted hue range to more mystic purples + blues,
                    // higher contrast and saturation for dreamlike depth
                    var colors = GenerateUniqueColorsDistinct(5, 0.5, 0.85, 0.5, 0.85);
                    for (int i = 0; i < colors.Count; i++)
                    {
                        double h, s, v;
                        ColorToHSV(colors[i], out h, out s, out v);
                        h = (h + 250 + i * 15) % 360;  // Deep purples to blue range
                        s = Math.Min(1.0, s * 1.1);
                        v = Math.Min(1.0, v * 1.05);
                        colors[i] = ColorFromHSV(h, s, v);
                    }
                    _lastMainStart = colors[0];
                    _lastMainEnd = colors[1];
                    _lastAccentsStart = colors[2];
                    _lastAccentsEnd = colors[3];
                    _lastTextColor = colors[4].GetBrightness() < 0.5 ? Color.WhiteSmoke : Color.DarkSlateGray;
                }
                break;

            case ThemeStyle.Inferno:
                {
                    // Move to deeper reds and oranges, stronger saturation and brightness for "hotter" firefeel
                    _lastMainStart = ColorFromHSV(_rand.Next(0, 10), 0.95, 0.5);
                    _lastMainEnd = ColorFromHSV(_rand.Next(10, 25), 1.0, 0.75);
                    _lastAccentsStart = ColorFromHSV(_rand.Next(30, 50), 1.0, 0.85);
                    _lastAccentsEnd = ColorFromHSV(_rand.Next(15, 35), 0.9, 0.65);
                    _lastTextColor = Color.FromArgb(255, 255, 240, 220);
                }
                break;

            case ThemeStyle.Frostbyte:
                {
                    // Icy blues leaning towards teals; crisper with a slight green tint
                    _lastMainStart = ColorFromHSV(190, 0.3, 0.98);
                    _lastMainEnd = ColorFromHSV(200, 0.35, 0.90);
                    _lastAccentsStart = ColorFromHSV(180, 0.7, 1.0);
                    _lastAccentsEnd = ColorFromHSV(210, 0.7, 0.85);
                    _lastTextColor = Color.FromArgb(255, 220, 235, 245);
                }
                break;

            case ThemeStyle.AlienTech:
                {
                    // Push into turquoise-green neon with some purple contrast
                    _lastMainStart = ColorFromHSV(170, 0.9, 0.45);
                    _lastMainEnd = ColorFromHSV(160, 0.95, 0.65);
                    _lastAccentsStart = ColorFromHSV(280, 0.95, 0.8);
                    _lastAccentsEnd = ColorFromHSV(300, 1.0, 0.6);
                    _lastTextColor = Color.FromArgb(255, 180, 255, 180);
                }
                break;

            case ThemeStyle.Void:
                {
                    // Near black but with richer blues and subtle purples to add depth
                    _lastMainStart = ColorFromHSV(240, 0.15, 0.08);
                    _lastMainEnd = ColorFromHSV(265, 0.18, 0.10);
                    _lastAccentsStart = ColorFromHSV(280, 0.4, 0.25);
                    _lastAccentsEnd = ColorFromHSV(320, 0.4, 0.20);
                    _lastTextColor = Color.WhiteSmoke;
                }
                break;

            case ThemeStyle.Classic:
                {
                    // Classic warm ochre and olive, with stronger saturation for liveliness
                    _lastMainStart = ColorFromHSV(30, 0.6, 0.90);
                    _lastMainEnd = ColorFromHSV(35, 0.65, 1.0);
                    _lastAccentsStart = ColorFromHSV(140, 0.4, 0.80);
                    _lastAccentsEnd = ColorFromHSV(160, 0.45, 0.85);
                    _lastTextColor = Color.FromArgb(255, 30, 30, 30);
                }
                break;

            case ThemeStyle.Vibrant:
                {
                    // Push saturation and brightness ranges even higher for maximum pop
                    var bases = GenerateUniqueColorsDistinct(5, 0.9, 1.0, 0.75, 1.0);
                    _lastMainStart = bases[0];
                    _lastMainEnd = bases[1];
                    _lastAccentsStart = bases[2];
                    _lastAccentsEnd = bases[3];
                    _lastTextColor = bases[4].GetBrightness() < 0.45 ? Color.White : Color.Black;
                }
                break;

            case ThemeStyle.Epic:
                {
                    // Blend sunset and dawn colors: warm reds and purples contrasting bright blues and yellows
                    _lastMainStart = ColorFromHSV(_rand.Next(310, 350), 0.85, 0.35);
                    _lastMainEnd = ColorFromHSV(_rand.Next(40, 70), 0.95, 0.80);
                    _lastAccentsStart = ColorFromHSV(_rand.Next(180, 210), 1.0, 0.9);
                    _lastAccentsEnd = ColorFromHSV(_rand.Next(60, 80), 0.8, 0.95);
                    _lastTextColor = Color.WhiteSmoke;
                }
                break;

            case ThemeStyle.Neon:
                {
                    // More electric and contrasting neon: hot pink, electric cyan, and bright purple
                    _lastMainStart = Color.Black;
                    _lastMainEnd = ColorFromHSV(SafeRandomRange(_rand, 320, 350), 1.0, 0.5);
                    _lastAccentsStart = ColorFromHSV(SafeRandomRange(_rand, 160, 200), 1.0, 1.0);
                    _lastAccentsEnd = ColorFromHSV(SafeRandomRange(_rand, 270, 310), 1.0, 0.8);
                    _lastTextColor = Color.White;
                }
                break;

            case ThemeStyle.Pastel:
                {
                    // Slightly saturated pastels with warm undertones for more warmth and charm
                    var pastels = GenerateUniqueColorsDistinct(5, 0.3, 0.5, 0.8, 0.9);
                    _lastMainStart = pastels[0];
                    _lastMainEnd = pastels[1];
                    _lastAccentsStart = pastels[2];
                    _lastAccentsEnd = pastels[3];
                    _lastTextColor = pastels[4].GetBrightness() > 0.75 ? Color.FromArgb(255, 40, 40, 40) : Color.WhiteSmoke;
                }
                break;

            case ThemeStyle.DarkGlow:
                {
                    // Dark richer colors with glowing coral and teal accents
                    var darks = GenerateUniqueColorsDistinct(4, 0.7, 0.9, 0.05, 0.18);
                    darks[2] = ColorFromHSV(15, 0.8, 0.75); // warm coral glow
                    darks[3] = ColorFromHSV(180, 0.8, 0.65); // teal glow
                    _lastMainStart = darks[0];
                    _lastMainEnd = darks[1];
                    _lastAccentsStart = darks[2];
                    _lastAccentsEnd = darks[3];
                    _lastTextColor = GenerateUniqueLightColorExcluding(darks);
                }
                break;

            case ThemeStyle.Oceanic:
                {
                    // Deeper ocean vibe with turquoise and teal added
                    var ocean = GenerateUniqueColorsDistinct(5, 0.7, 0.9, 0.4, 0.8);
                    for (int i = 0; i < ocean.Count; i++)
                    {
                        double h, s, v;
                        ColorToHSV(ocean[i], out h, out s, out v);
                        h = (h + 170 + i * 15) % 360;
                        ocean[i] = ColorFromHSV(h, s, v);
                    }
                    _lastMainStart = ocean[0];
                    _lastMainEnd = ocean[1];
                    _lastAccentsStart = ocean[2];
                    _lastAccentsEnd = ocean[3];
                    _lastTextColor = ocean[4].GetBrightness() < 0.5 ? Color.White : Color.Black;
                }
                break;

            case ThemeStyle.Sunset:
                {
                    // More dramatic sunset with deeper oranges and reds, slightly more purple hints
                    var sunset = GenerateUniqueColorsDistinct(5, 0.7, 0.95, 0.5, 0.85);
                    for (int i = 0; i < sunset.Count; i++)
                    {
                        double h, s, v;
                        ColorToHSV(sunset[i], out h, out s, out v);
                        h = (h + 20 + i * 10) % 70 + 10;
                        sunset[i] = ColorFromHSV(h, s, v);
                    }
                    _lastMainStart = sunset[0];
                    _lastMainEnd = sunset[1];
                    _lastAccentsStart = sunset[2];
                    _lastAccentsEnd = sunset[3];
                    _lastTextColor = sunset[4].GetBrightness() < 0.5 ? Color.White : Color.Black;
                }
                break;

            case ThemeStyle.Cyberpunk:
                {
                    // More neon magentas and sharp cyan, increased contrast
                    var cyber = GenerateUniqueColorsDistinct(5, 0.85, 1.0, 0.15, 0.5);
                    double[] cyberHueTargets = { 300, 330, 190, 220, 270 };
                    for (int i = 0; i < cyberHueTargets.Length; i++)
                    {
                        double h, s, v;
                        ColorToHSV(cyber[i], out h, out s, out v);
                        h = cyberHueTargets[i];
                        cyber[i] = ColorFromHSV(h, s, v);
                    }
                    _lastMainStart = cyber[0];
                    _lastMainEnd = cyber[1];
                    _lastAccentsStart = cyber[2];
                    _lastAccentsEnd = cyber[3];
                    _lastTextColor = cyber[4].GetBrightness() < 0.45 ? Color.White : Color.Black;
                }
                break;

            case ThemeStyle.Forest:
                {
                    // Add some brighter lime greens, richer forestry with golden highlights
                    var forest = GenerateUniqueColorsDistinct(5, 0.55, 0.85, 0.3, 0.7);
                    for (int i = 0; i < forest.Count; i++)
                    {
                        double h, s, v;
                        ColorToHSV(forest[i], out h, out s, out v);
                        h = 80 + (i * 10);
                        forest[i] = ColorFromHSV(h, s, v);
                    }
                    _lastMainStart = forest[0];
                    _lastMainEnd = forest[1];
                    _lastAccentsStart = forest[2];
                    _lastAccentsEnd = forest[3];
                    _lastTextColor = forest[4].GetBrightness() > 0.75 ? Color.FromArgb(255, 15, 15, 15) : Color.White;
                }
                break;

            case ThemeStyle.TechnoWave:
                {
                    // More electric cyan base with purple and magenta wave
                    _lastMainStart = ColorFromHSV(_rand.Next(190, 210), 0.95, 0.15);
                    _lastMainEnd = ColorFromHSV(_rand.Next(210, 230), 0.95, 0.4);
                    _lastAccentsStart = ColorFromHSV(_rand.Next(280, 320), 0.9, 0.85);
                    _lastAccentsEnd = ColorFromHSV(_rand.Next(310, 350), 0.9, 0.9);
                    _lastTextColor = Color.White;
                }
                break;
        }

    }

    Theme(_lastMainStart, _lastMainEnd, _lastAccentsStart, _lastAccentsEnd, _lastTextColor);
}