mastermind 0.1.4

Based off of the old board game. The user enters a number, which generates a hidden code comprised of that many colors (ROY G BIV + black/white), where duplicates are allowed. The user then has 12 attempts to guess what the code is. See the rest on GitHub.
Documentation
use std::cmp;
use std::fmt;

pub const NUM_COLORS: u32 = 9;

#[derive(Clone, Debug)]
pub enum Color {
    Red,
    Orange,
    Yellow,
    Green,
    Blue,
    Indigo,
    Purple,
    Black,
    White,
}

impl Color {
    pub fn new(n: u32) -> Color {
        use color::Color::*;
        match n {
            0 => Red,
            1 => Orange,
            2 => Yellow,
            3 => Green,
            4 => Blue,
            5 => Indigo,
            6 => Purple,
            7 => Black,
            _ => White
        }
    }
}

impl fmt::Display for Color {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{:?}", self)
    }
}

impl cmp::PartialEq for Color {
    fn eq(&self, other: &Color) -> bool {
        if self.to_string() == other.to_string() {
            true
        } else {
            false
        }
    }
}