//
//  UIColor+GMTheme.m
//  GMKit
//
//  Created by wangyang on 2017/11/8.
//

#import <UIColor+GMTheme.h>


//用户版色值
#ifdef IS_USER

//颜色规范
#define MAIN_VISUAL_COLOR                       RGBCOLOR_HEX(0x3ADBD2) //主视觉颜色
#define SECONDARY_VISUAL_COLOR                  RGBCOLOR_HEX(0xFF7690) //辅助颜色
#define SEPARATOR_LINE_COLOR                    RGBCOLOR_HEX(0xE5E5E5) //分割线颜色、边框颜色
#define BACKGROUND_COLOR                        RGBCOLOR_HEX(0xF4F3F8) //背景颜色
#define DISABLE_COLOR                           RGBCOLOR_HEX(0xD5D5D5) //失效颜色
#define BACKGROUND_TIP_COLOR                    RGBCOLOR_HEX(0xFFFBE4) //提示背景颜色(黄)
#define TAG_BACKGROUND_COLOR                    RGBCOLOR_HEX(0xF0F0F0) //tag背景颜色

#define TAG_SELECTED_COLOR                      RGBCOLOR_HEX(0x24DAE0)

//文字颜色
#define HEADLINE_TEXT_COLOR                     RGBCOLOR_HEX(0x282828) //一级标题字、主要内容
#define BODY_TEXT_COLOR                         RGBCOLOR_HEX(0x464646) //正文、普通文字内容
#define AUXILIARY_TEXT_GREEN                    RGBCOLOR_HEX(0x4ABAB4) //可点击状态的文字更美绿
#define AUXILIARY_TEXT_RED                      RGBCOLOR_HEX(0xFF7690) //文字的更美红
#define AUXILIARY_TEXT_YELLOW                   RGBCOLOR_HEX(0x9D704F) //文字的更美黄提示色
#define AUXILIARY_TEXT_COLOR_DARK               RGBCOLOR_HEX(0x666666) //辅助文字色
#define AUXILIARY_TEXT_COLOR_LIGHT              RGBCOLOR_HEX(0x999999) //辅助文字色
#define AUXILIARY_TEXT_COLOR_EXTRA_LIGHT        RGBCOLOR_HEX(0xcccccc) //辅助文字色

//按钮颜色
#define BUTTON_NORMAL_GREEN_COLOR               RGBCOLOR_HEX(0x3ADBD2) //目前和MAIN_VISUAL_COLOR一样
#define BUTTON_HIGHLIGHT_GREEN_COLOR            RGBCOLOR_HEX(0x1FB2A7)
#define BUTTON_NORMAL_RED_COLOR                 RGBCOLOR_HEX(0xFF7690) //目前和SECONDARY_VISUAL_COLOR一样
#define BUTTON_HIGHLIGHT_RED_COLOR              RGBCOLOR_HEX(0xE75873)
#define BUTTON_DISABLE_COLOR                    RGBCOLOR_HEX(0xD5D5D5) //目前和DISABLE_COLOR一样



//医生版色值，目前未支持
#elif IS_DOCTOR

//颜色规范
#define MAIN_VISUAL_COLOR                       RGBCOLOR_HEX(0x3ADBD2) //医生版主视觉颜色,暂时改为红色，用来区分
#define SECONDARY_VISUAL_COLOR                  RGBCOLOR_HEX(0xFF7690) //医生版辅助颜色
#define SEPARATOR_LINE_COLOR                    RGBCOLOR_HEX(0xE5E5E5) //医生版分割线颜色、边框颜色
#define DISABLE_COLOR                           RGBCOLOR_HEX(0xD5D5D5) //医生版失效颜色
#define BACKGROUND_COLOR                        RGBCOLOR_HEX(0xF5F5F5) //医生版背景颜色
#define BACKGROUND_TIP_COLOR                    RGBCOLOR_HEX(0xF8F4DD) //医生版提示背景颜色(黄)
#define TAG_BACKGROUND_COLOR                    RGBCOLOR_HEX(0xF0F0F0) //医生版tag背景颜色
#define TAG_SELECTED_COLOR                      RGBCOLOR_HEX(0x24DAE0) //tag标签选中颜色

//文字颜色
#define HEADLINE_TEXT_COLOR                     RGBCOLOR_HEX(0x282828) //一级标题字、主要内容
#define BODY_TEXT_COLOR                         RGBCOLOR_HEX(0x464646) //正文、普通文字内容
#define AUXILIARY_TEXT_GREEN                    RGBCOLOR_HEX(0x4ABAB4) //可点击状态的文字更美绿
#define AUXILIARY_TEXT_RED                      RGBCOLOR_HEX(0xFF7690) //文字的更美红
#define AUXILIARY_TEXT_YELLOW                   RGBCOLOR_HEX(0x9D704F) //文字的更美黄提示色
#define AUXILIARY_TEXT_COLOR_DARK               RGBCOLOR_HEX(0x666666) //辅助文字色
#define AUXILIARY_TEXT_COLOR_LIGHT              RGBCOLOR_HEX(0x999999) //辅助文字色
#define AUXILIARY_TEXT_COLOR_EXTRA_LIGHT        RGBCOLOR_HEX(0xcccccc) //辅助文字色

//按钮颜色
#define BUTTON_NORMAL_GREEN_COLOR               RGBCOLOR_HEX(0x3ADBD2) //目前和MAIN_VISUAL_COLOR一样
#define BUTTON_HIGHLIGHT_GREEN_COLOR            RGBCOLOR_HEX(0x1FB2A7)
#define BUTTON_NORMAL_RED_COLOR                 RGBCOLOR_HEX(0xFF7690) //目前和SECONDARY_VISUAL_COLOR一样
#define BUTTON_HIGHLIGHT_RED_COLOR              RGBCOLOR_HEX(0xE75873)
#define BUTTON_DISABLE_COLOR                    RGBCOLOR_HEX(0xD5D5D5) //目前和DISABLE_COLOR一样



#else  //这里的默认色值可以随意,默认填的是用户板的色值


//颜色规范
#define MAIN_VISUAL_COLOR                       RGBCOLOR_HEX(0x3ADBD2) //主视觉颜色
#define SECONDARY_VISUAL_COLOR                  RGBCOLOR_HEX(0xFF7690) //辅助颜色
#define SEPARATOR_LINE_COLOR                    RGBCOLOR_HEX(0xE5E5E5) //分割线颜色、边框颜色
#define BACKGROUND_COLOR                        RGBCOLOR_HEX(0xF4F3F8) //背景颜色
#define DISABLE_COLOR                           RGBCOLOR_HEX(0xD5D5D5) //失效颜色
#define BACKGROUND_TIP_COLOR                    RGBCOLOR_HEX(0xFFFBE4) //提示背景颜色(黄)
#define TAG_BACKGROUND_COLOR                    RGBCOLOR_HEX(0xF0F0F0) //tag背景颜色

#define TAG_SELECTED_COLOR                      RGBCOLOR_HEX(0x24DAE0) //tag标签选中颜色
//文字颜色
#define HEADLINE_TEXT_COLOR                     RGBCOLOR_HEX(0x282828) //一级标题字、主要内容
#define BODY_TEXT_COLOR                         RGBCOLOR_HEX(0x464646) //正文、普通文字内容
#define AUXILIARY_TEXT_GREEN                    RGBCOLOR_HEX(0x4ABAB4) //可点击状态的文字更美绿
#define AUXILIARY_TEXT_RED                      RGBCOLOR_HEX(0xFF7690) //文字的更美红
#define AUXILIARY_TEXT_YELLOW                   RGBCOLOR_HEX(0x9D704F) //文字的更美黄提示色
#define AUXILIARY_TEXT_COLOR_DARK               RGBCOLOR_HEX(0x666666) //辅助文字色
#define AUXILIARY_TEXT_COLOR_LIGHT              RGBCOLOR_HEX(0x999999) //辅助文字色
#define AUXILIARY_TEXT_COLOR_EXTRA_LIGHT        RGBCOLOR_HEX(0xcccccc) //辅助文字色

//按钮颜色
#define BUTTON_NORMAL_GREEN_COLOR               RGBCOLOR_HEX(0x3ADBD2) //目前和MAIN_VISUAL_COLOR一样
#define BUTTON_HIGHLIGHT_GREEN_COLOR            RGBCOLOR_HEX(0x1FB2A7)
#define BUTTON_NORMAL_RED_COLOR                 RGBCOLOR_HEX(0xFF7690) //目前和SECONDARY_VISUAL_COLOR一样
#define BUTTON_HIGHLIGHT_RED_COLOR              RGBCOLOR_HEX(0xE75873)
#define BUTTON_DISABLE_COLOR                    RGBCOLOR_HEX(0xD5D5D5) //目前和DISABLE_COLOR一样


#endif


@implementation UIColor (GMTheme)

/**
   用于色值是数字
*/
+ (UIColor *)colorWithHex:(NSInteger)hex{
    return  [UIColor colorWithHex:hex alpha:1.0];
}

+ (UIColor *)colorWithHex:(NSInteger)hex alpha:(CGFloat)alpha{
    CGFloat r = ((hex & 0xFF0000) >> 16) / 255.0;
    CGFloat g = ((hex & 0x00FF00) >> 8) / 255.0;
    CGFloat b = ((hex & 0x0000FF) >> 0) / 255.0;
    return [UIColor colorWithRed:r green:g blue:b alpha:alpha];
}

/**
 用于色值字符串
 */

+ (UIColor *)colorWithHexString:(NSString *)hexString{
    return [UIColor colorWithHexString:hexString alpha:1.0];
}

+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha{
    unsigned int hex = 0;
    NSScanner * scanner = [NSScanner scannerWithString:hexString];
    if([scanner scanHexInt:&hex]){
        return [UIColor colorWithHex:(NSInteger)hex alpha:alpha];
    }else{
        return [[UIColor alloc]init];
    }
}


/**
 色值库里的各种色值
 */
+ (UIColor *)mainVisual{
    return MAIN_VISUAL_COLOR;
}

+ (UIColor *)secondaryVisual{
    return SECONDARY_VISUAL_COLOR;
}

+ (UIColor *)disable{
    return DISABLE_COLOR;
}

+ (UIColor *)separatorLine{
    return SEPARATOR_LINE_COLOR;
}

+ (UIColor *)background{
    return BACKGROUND_COLOR;
}

+ (UIColor *)backgroundTip{
    return BACKGROUND_TIP_COLOR;
}

+ (UIColor *)tagBackground{
    return TAG_BACKGROUND_COLOR;
}

+ (UIColor *)headlineText{
    return HEADLINE_TEXT_COLOR;
}

+ (UIColor *)bodyText{
    return BODY_TEXT_COLOR;
}

+ (UIColor *)auxiliaryTextGreen{
    return AUXILIARY_TEXT_GREEN;
}

+ (UIColor *)auxiliaryTextRed{
    return AUXILIARY_TEXT_RED;
}

+ (UIColor *)auxiliaryTextYellow{
    return AUXILIARY_TEXT_YELLOW;
}

+ (UIColor *)auxiliaryTextDark{
    return AUXILIARY_TEXT_COLOR_DARK;
}

+ (UIColor *)auxiliaryTextLight{
    return AUXILIARY_TEXT_COLOR_LIGHT;
}

+ (UIColor *)auxiliaryTextExtraLight{
    return AUXILIARY_TEXT_COLOR_EXTRA_LIGHT;
}

+ (UIColor *)buttonNormalGreen{
    return BUTTON_NORMAL_GREEN_COLOR;
}

+ (UIColor *)buttonHighlightGreen{
    return BUTTON_HIGHLIGHT_GREEN_COLOR;
}

+ (UIColor *)buttonNormalRed{
    return BUTTON_NORMAL_RED_COLOR;
}

+ (UIColor *)buttonHighlightRed{
    return BUTTON_HIGHLIGHT_RED_COLOR;
}

+ (UIColor *)buttonDisable{
    return BUTTON_DISABLE_COLOR;
}

+ (UIColor *)tagSelectedGreen {
    return TAG_SELECTED_COLOR;
}

@end
