// Copyright (c) 2017, Marty Mills <daggerbot@gmail.com>
// This software is available under the terms of the zlib license.
// See COPYING.md for more information.

use conv::IntoColor;
use rgb::Rgb;

/// Common color constants.
pub trait Color : Sized
    where Rgb<u8>: IntoColor<Self>
{
    fn aqua () -> Self { ::rgb(0x00ffff) }
    fn black () -> Self { ::rgb(0x000000) }
    fn blue () -> Self { ::rgb(0x0000ff) }
    fn brown () -> Self { ::rgb(0x804000) }
    fn dark_gray () -> Self { ::rgb(0x404040) }
    fn darker_gray () -> Self { ::rgb(0x202020) }
    fn gray () -> Self { ::rgb(0x808080) }
    fn green () -> Self { ::rgb(0x008000) }
    fn fuchsia () -> Self { ::rgb(0xff00ff) }
    fn light_gray () -> Self { ::rgb(0xc0c0c0) }
    fn lighter_gray () -> Self { ::rgb(0xe0e0e0) }
    fn lime () -> Self { ::rgb(0x00ff00) }
    fn maroon () -> Self { ::rgb(0x800000) }
    fn navy () -> Self { ::rgb(0x000080) }
    fn olive () -> Self { ::rgb(0x808000) }
    fn orange () -> Self { ::rgb(0xff8000) }
    fn purple () -> Self { ::rgb(0x800080) }
    fn red () -> Self { ::rgb(0xff0000) }
    fn teal () -> Self { ::rgb(0x008080) }
    fn white () -> Self { ::rgb(0xffffff) }
    fn yellow () -> Self { ::rgb(0xffff00) }
}

impl<T> Color for T where Rgb<u8>: IntoColor<T> {}
