# Author: Scott Wehrwein
# Date: 5/14/25
# A demo of fading colors with turtles

import turtle


def fade_to_blue(t, distance):
    """ Make turtle t go forward by distance with the color gradually changing
    from black to blue"""
    t.color(0,0,0)
    blue = 0
    blue_step = 255 / distance
    
    
    for x in range(distance):
        t.forward(1)
        blue = x * blue_step
        t.color(int(blue), 0, 0)
    
if __name__ == "__main__":
    t = turtle.Turtle()
    turtle.colormode(255)
    t.width(5)
    fade_to_blue(t, 200)
    turtle.done()