//
//  ANColorHelper.h
//  AvisNocturnaCrossCore
//
//  Created by Mendel Kucharzeck on 19.12.11.
//  Copyright 2011 AvisNocturna Software. All rights reserved.
//

@interface ANColorHelper : NSObject


+ (void) setStrokeColorWithRed:(float)r green:(float)g blue:(float)b alpha:(float)a inContext:(CGContextRef)context;
+ (void) setFillColorWithRed:(float)r green:(float)g blue:(float)b alpha:(float)a inContext:(CGContextRef)context;

+ (CGColorRef) newCGColorRefWithRed:(float)r green:(float)g blue:(float)b alpha:(float)a;
+ (CGColorRef) newCGColorRefFromPlattformColor:(id)color;

+ (id) platformColorWithRed:(float)r green:(float)g blue:(float)b alpha:(float)a;
+ (id) platformColorWithHue:(float)h brightness:(float)b saturation:(float)s alpha:(float)a;
+ (id) platformColor:(id)color withAlpa:(float)alpha;

+ (BOOL) getPlatformColorComponents:(float*)components fromPlatformColor:(id)color;
+ (BOOL) getPlatformColorHue:(float*)hue brightness:(float*)brightness saturation:(float*)saturation alpha:(float*)alpha fromPlatformColor:(id)color;
+ (BOOL) isPlatformColorOpaque:(id)color;

+ (void) setStrokeColorFromPlatformColor:(id)color;
+ (void) setFillColorFromPlatformColor:(id)color;

//To / From String
+ (id) platformColorFromString:(NSString*)string;
+ (NSString*) stringFromPlatformColor:(id)color;

//Archive
+ (BOOL) archiver:(NSCoder*)coder containsColorForKey:(NSString*)key;
+ (void) archivePlatformColor:(ANPlatformColor*)color forKey:(NSString*)key withCoder:(NSCoder*)coder;
+ (ANPlatformColor*) unarchivePlatformColorForKey:(NSString*)key withCoder:(NSCoder*)coder;

@end
