/***************************************************************************
                            KColor.m -  description
                             -------------------
    begin                : Fri Mar  8 13:55:08 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar  8 13:55:08 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <kdec/kde_KColor.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KColor.h>

@implementation  KColor


- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KColor()];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- copyWithZone: (NSZone *) zone
{
	KColor * aCopy;
	aCopy = [[(KColor *)[[self class] allocWithZone: zone] setQt: kde_new_KColor1([self qt])] init];
	[aCopy setAllocatedInObjcWorld: YES];
	[QtSupport setObject: aCopy forQtKey: [aCopy qt]];
	return aCopy;
}

- initWithColor: (QColor *)col
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KColor2((qt_QColor *) [col qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- setHsv: (int)_h _s: (int)_s _v: (int)_v
{
	kde_KColor_setHsv((kde_KColor *)[self qt], (int)_h, (int)_s, (int)_v);
	return self;
}

- setRgb: (int)_r _g: (int)_g _b: (int)_b
{
	kde_KColor_setRgb((kde_KColor *)[self qt], (int)_r, (int)_g, (int)_b);
	return self;
}

- rgb: (int*)_r _g: (int*)_g _b: (int*)_b
{
	kde_KColor_rgb((kde_KColor *)[self qt], (int*)_r, (int*)_g, (int*)_b);
	return self;
}

- hsv: (int*)_h _s: (int*)_s _v: (int*)_v
{
	kde_KColor_hsv((kde_KColor *)[self qt], (int*)_h, (int*)_s, (int*)_v);
	return self;
}

@end
