• setfloodcolor with variables

    From Kent Burel@21:1/5 to All on Thu Aug 10 13:15:37 2023
    I'm trying to explore colors. So I want to loop through the red, green, and blue values to see the various colors. setfloodcolor does the job. But how do I pass variables to setfloodcolor? My code looks like this:

    to mycolors
    cs
    pd
    repeat 4 [fd 100 rt 90]
    pu
    rt 45
    fd 20

    make "red 0
    make "green 0
    make "blue 0
    make "colorarray array 3
    while [:red<256] [
    while [:green<256] [
    while [:blue<256] [
    setitem 1 :colorarray :red
    setitem 2 :colorarray :green
    setitem 3 :colorarray :blue
    setfloodcolor [:red :green :blue]
    fill
    make "blue :blue+1]
    make "green :green+1]
    make "red :red+1]
    end

    When I run it I get

    setfloodcolor doesn't like [:red :green :blue] as input in mycolors

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kent Burel@21:1/5 to All on Thu Aug 10 18:25:42 2023
    I figured out my problem. I've got it to work. Now it look like this:

    to mycolors
    cs
    pd
    repeat 4 [fd 200 rt 90]
    pu
    rt 45
    fd 20

    make "red 0
    make "green 0
    make "blue 0
    while [:red<257] [
    while [:green<257] [
    while [:blue<257] [
    setfloodcolor (list :red :green :blue)
    fill
    make "blue :blue+1
    ]
    make "blue 0
    make "green :green+1
    ]
    make "blue 0
    make "green 0
    make "red :red+1
    ]
    end

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)