import tkinter as tk
import random
from math import sin, cos
import math

root = tk.Tk()
root.title("Canvas")

SIZE_X = 600
SIZE_Y = 600

pivot_x = SIZE_X // 2
pivot_y = SIZE_Y // 2


def random_hex_color():
    r = random.randint(0, 255)
    g = random.randint(0, 255)
    b = random.randint(0, 255)
    return f"#{r:02x}{g:02x}{b:02x}"


step_count = int(input("Enter the amount of steps: "))
step_size = 360 / step_count
text_to_display = input("Enter the text to display: ")
gap_from_center = int(input("Enter the gap from the center: "))

canvas = tk.Canvas(root, width=SIZE_X, height=SIZE_Y, bg="#112233")
canvas.pack(padx=20, pady=20)

for i in range(step_count):
    angle_deg = step_size * i
    diff_x = sin(math.radians(angle_deg + 90)) * gap_from_center
    diff_y = cos(math.radians(angle_deg + 90)) * gap_from_center
    x = diff_x + pivot_x
    y = diff_y + pivot_y
    canvas.create_text(
        x,
        y,
        angle=angle_deg,
        text=text_to_display,
        font=("Consolas", 14),
        fill=random_hex_color(),
        anchor=tk.W,
    )

root.mainloop()
 
