import pygame
from pygame.locals import *
import sys

pygame.init()
screen = pygame.display.set_mode((600, 500))
pygame.display.set_caption("Drawing Lines")
color = 100, 255, 200
vel_a = 2
vel_b = 3
vel_c = 1
while True:
    for event in pygame.event.get():
        if event.type in (QUIT, KEYDOWN):
            sys.exit()
    screen.fill((0, 80, 0))
    screen.fill(color)
    temp = list(color)
    if temp[0] > 250 or temp[0] < 5:
        vel_a = -vel_a
    if temp[1] > 250 or temp[1] < 5:
        vel_b = -vel_b
    if temp[2] > 250 or temp[2] < 5:
        vel_c = -vel_c
    temp[0] += vel_a
    temp[1] += vel_b
    temp[2] += vel_c
    color = tuple(temp)
    pygame.display.update()
