0

I have got my code for the circle but I just need the glow to look like a white shining sun but I have tried so many different things and none have worked

This is my code so far and it creates a randomized white sun size which is what I need but it needs to also have a glow something like this CODE RIGHT NOW INCLUDING SUNSET:

import turtle
import random
s = turtle.getscreen()
t = turtle.Turtle()
t.speed(100)
t.pensize(4)
from turtle import Screen, Turtle

COLOR = (1, 0.7, 0.06)
TARGET = (0.8, 0.09, 0.1)
#Sunset
screen = Screen()
screen.tracer(False)
screen.setup(width = 1.0, height = 1.0)

WIDTH, HEIGHT = screen.window_width(), screen.window_height()

deltas = [(hue - COLOR[index]) / HEIGHT for index, hue in enumerate(TARGET)]

turtle = Turtle()
turtle.color(COLOR)

turtle.penup()
turtle.goto(-WIDTH/2, HEIGHT/2)
turtle.pendown()

direction = 1

for distance, y in enumerate(range(HEIGHT//2, -HEIGHT//2, -1)):

    turtle.forward(WIDTH * direction)
    turtle.color([COLOR[i] + delta * distance for i, delta in enumerate(deltas)])
    turtle.sety(y)

    direction *= -1

screen.tracer(True)

#Sun
def Sun (color):
    t.pu()
    t.goto(-400,-250)
    t.color(color)
    t.pd()
    rad = random.randint(100,220)
    t.begin_fill()
    t.circle(rad)
    t.end_fill()
    t.pu()
Sun("White")

This is the glowing white sun which I need it to loom like

Alec
  • 1
  • 1
  • That's hard to do with `turtle` not supporting RGBA. – Armali Aug 02 '23 at 13:59
  • Thank you for answering, but do you know if it is possible – Alec Aug 03 '23 at 00:45
  • I don't know for sure. (If I had to do this, I would look for a graphics module with RGBA support.) - The question [Python Turtle Opacity?](https://stackoverflow.com/questions/20322465/python-turtle-opacity) has some answers suggesting there are `turtle` implementations with RGBA, but it's not so on my system, so I can't try. – Armali Aug 03 '23 at 08:14

0 Answers0