diff -r 000000000000 -r f58d6ec98e88 gfxtools/Color/src/Palette6.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfxtools/Color/src/Palette6.cpp Thu Dec 17 09:14:18 2009 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#include "ColorImp.h" + +const TRgb KPalette6[30] = + { + 0x00F7FFEF, + 0x00EFFFD6, + 0x00E6FFBD, + 0x00DEFF9C, + 0x00D6FF7B, + 0x00C5FF5A, + 0x00BDFF3A, + 0x00ADFF10, + 0x009CEB00, + 0x0084C600, + 0x006BA200, + 0x00528200, + 0x00426100, + 0x00294100, + 0x00192800, + 0x00081000, + 0x00FEFEFE, + 0x009CCA31, + 0x00FFFFCE, + 0x00FEFEFE, // undefined + 0x00FEFEFE, // undefined + 0x00FEFEFE, // undefined + 0x00FEFEFE, // undefined + 0x0000EEFF, // coding yellow + 0x000000DD, // coding red + 0x00FF7700, // coding blue + 0x0000EE00, // coding green + 0x00339900, // nokia brand color green 253 + 0x00CC3300, // nokia brand color blue 254 + 0x00DD00DD // mask pink + }; + +TRgb TPalette6::Color(int aIndex) const + { + // color rotation for palette + if (aIndex == 0) + return TRgb(0x00000000); + else if (aIndex == 0xff) + return TRgb(0x00ffffff); + else if (aIndex == 215) + return TRgb(0x00dd00dd); + else if (aIndex < StandardGrayBase) + { + return TRgb(KColorCubeMap[aIndex/36], KColorCubeMap[(aIndex/6)%6], KColorCubeMap[aIndex%6]); + } + else if (aIndex < SchemeSpecificColorBase) + { + int gray = aIndex - StandardGrayBase; + return TRgb(KStandardGray[gray], KStandardGray[gray], KStandardGray[gray]); + } + else + { + return TRgb(KPalette6[aIndex - SchemeSpecificColorBase]); + } + }; + +// End of File