help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
star-pattern-maker
/
js
RSK World
star-pattern-maker
Star Pattern Maker - HTML5 Canvas + 3D Rendering + Physics Simulation + AI Patterns + Generative Audio + Modern UI + Glassmorphism Design
js
  • 3d-engine.js3.8 KB
  • ai-patterns.js5.6 KB
  • animations.js1.4 KB
  • audio.js1.3 KB
  • controls.js12.2 KB
  • export.js3.9 KB
  • filters.js3.5 KB
  • fractals.js3.5 KB
  • gallery.js2.5 KB
  • main.js1.9 KB
  • particles.js1.4 KB
  • physics.js1.7 KB
  • presets.js2.8 KB
  • randomizer.js1.4 KB
  • renderer.js7 KB
  • shaders.js6.5 KB
  • shapes.js1.7 KB
  • sound-gen.js4.4 KB
  • state.js1.9 KB
  • symmetry.js3.9 KB
  • themes.js1.4 KB
  • timeline.js4.2 KB
  • utils.js546 B
randomizer.js
js/randomizer.js
Raw Download
Find: Go to:
/* V10 Randomizer Module */
import { THEMES } from './themes.js';

export function randomizeState(state) {
    // Geometry
    state.spikes = Math.floor(Math.random() * 10) + 3; // 3 to 12
    state.outerRadius = Math.floor(Math.random() * 150) + 50;
    state.innerRadius = Math.floor(Math.random() * 100) + 20;
    state.lineWidth = Math.floor(Math.random() * 10) + 1;
    state.curve = Math.floor(Math.random() * 40) - 20; // -20 to 20
    state.twist = Math.floor(Math.random() * 90) - 45; // -45 to 45

    // Modes (Weighted Random)
    state.fractalMode = Math.random() > 0.8;
    state.wallpaperMode = Math.random() > 0.8;
    state.kaleidoscopeMode = (!state.wallpaperMode && Math.random() > 0.7);

    if (state.fractalMode) state.fractalDepth = Math.floor(Math.random() * 2) + 2; // 2 or 3
    if (state.kaleidoscopeMode) state.segments = Math.floor(Math.random() * 6) + 4;

    // Effects
    state.glow = Math.random() > 0.5 ? Math.floor(Math.random() * 30) : 0;
    state.pulseEnabled = Math.random() > 0.6;
    state.rainbowMode = Math.random() > 0.8;

    // Apply a random Theme for colors
    const theme = THEMES[Math.floor(Math.random() * THEMES.length)];
    state.fillColor = theme.fillColor;
    state.fillColor2 = theme.fillColor2;
    state.strokeColor = theme.strokeColor;
    state.bgColor = theme.bgColor;
    state.useGradient = true;

    return state;
}
36 lines•1.4 KB
javascript

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer