Cleaned up code and changed Rule function to accept a color value
intended to represent the current state of the pixel the rule is being
applied to.