enter image description here I just finished the code for breakout.c and I received no errors when I typed in "make breakout". However when I typed in ./breakout I received a whole lot of errors saying that there was an Unexpected error. So is there something wrong with my code? Unexpected error:decodeError:illegal color value

  • Given what we see, I'm betting that the number of errors is equal to the number of bricks, or slightly more, depending on what other objects you are giving a color. Can you post the code that you use to make your bricks?
    – Cliff B
    Jul 7 '15 at 21:55
  • I just posted the code.
    – Bryan99
    Jul 8 '15 at 0:35
  • @CliffB I don't see any usage to getColor here!
    – kzidane
    Jul 8 '15 at 9:59
  • Is this still happening? Your code looks fine to me and worked when I tried it. Can you do some testing by simplifying and just setting setColor(brick,"RED"); for all bricks? Does that work? Or do you get the runtime errors for all bricks?
    – curiouskiwi
    Jul 10 '15 at 4:24

I had the same problem, and I cleared it up by replacing Purple, not recognised by the Stanford Portable Library, with another colour. Your colours all appear to be ones recognised by the library but that screenshot isn't the whole function so I'm assuming lower in the code you have an unrecognised colour.

From: http://cdn.cs50.net/2013/fall/lectures/5/m/src5m/spl/doc/gobjects.html#Function:setColor these are the colours that can be used:BLUE, CYAN, DARK_GRAY, GRAY, GREEN, LIGHT_GRAY, MAGENTA, ORANGE, PINK, RED, WHITE and YELLOW.


Try using 'Red' instead of 'RED' and so on for the rest of the colors.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .