/Polka-Dot-Generator

"Shreya's Python canvas magic - Hirst Painting Art 🎨✨

Primary LanguagePythonMIT LicenseMIT

The Polka Dot Generator 🎨

Welcome to the beginner-friendly project - " The Polka Dot Generator "

Crafted and taught by Shreya Malogi! 🌐

GitHub stars

Project Details: 💻🌐📅✍️

  • Functionality: Generates stunning Hirst-inspired paintings using Python's Turtle module.
  • Tech Stack: Python, turtle-GUI
  • Author: @shreyamalogi
  • Year of Project: 2021

Table of Contents 📚

  1. Introduction
  2. Prerequisites
  3. Installation
  4. Running the Script
  5. Customizing Your Painting
  6. Understanding the Code

Introduction 🎨

This Python script utilizes the Turtle module to create a stunning Hirst-inspired painting. Let's embark on your artistic coding journey! 🚀

Prerequisites 🛠️

Before you dive in, make sure you have Python installed on your machine. If not, you can download it here.

Installation 🐢

You'll need the turtle module to run this script. Install it using:

pip install PythonTurtle

Running the Script ▶️

  1. Open the script in your favorite Python environment.
  2. Run the script. This will launch the Turtle graphics window.

Customizing Your Painting 🎨

The script uses a predefined color_list variable containing RGB tuples. Feel free to customize this list to create your unique color palette. 🌈

Understanding the Code 🤓

Let's break down the script:

import turtle as turtle_module
import random

# ... (other imports)

turtle_module.colormode(255)
myrtle = turtle_module.Turtle()
myrtle.speed("fastest")
myrtle.penup()
myrtle.hideturtle()

color_list = [(202, 164, 109), (238, 240, 245), ... , (176, 192, 209)]

# ... (more code)

screen = turtle_module.Screen()
screen.exitonclick()
  • colormode(255): Configures Turtle to use RGB values ranging from 0 to 255.
  • Turtle(): Creates a Turtle object named myrtle.
  • speed("fastest"): Sets the drawing speed to the fastest.
  • penup(): Lifts the pen, so no drawing occurs when moving.
  • hideturtle(): Hides the turtle cursor.

Running the Painting Loop 🔄

The script uses a loop to draw dots on the canvas:

for dot_count in range(1, number_of_dots + 1):
    myrtle.dot(20, random.choice(color_list))
    myrtle.forward(50)

    if dot_count % 10 == 0:
        # ... (code for changing direction and position)

Exploring Your Art 🌌

The script will create a unique Hirst-inspired artwork. Experiment with colors and settings to make it your own! Enjoy the creative process! 🎉

Contribution- Show Your Support (Star This) ⭐🌟📜✨

Feel the magic within you? Contribute to this enchanting spellbook and make it even more magical. Don't forget to star the project! ⭐🌟

License 🕊️

This project is enchanted under the spell of the MIT License. Share the magic responsibly!

MIT License

Copyright (c) 2021 Shreya Malogi

Stay Enchanted! 🌍💙