gfxtools/Color/src/Palette6.cpp
changeset 0 f58d6ec98e88
equal deleted inserted replaced
-1:000000000000 0:f58d6ec98e88
       
     1 /*
       
     2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *       
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "ColorImp.h"
       
    21 
       
    22 const TRgb KPalette6[30] =
       
    23 	{
       
    24     0x00F7FFEF,
       
    25     0x00EFFFD6,
       
    26     0x00E6FFBD,
       
    27     0x00DEFF9C,
       
    28     0x00D6FF7B,
       
    29     0x00C5FF5A,
       
    30     0x00BDFF3A,
       
    31     0x00ADFF10,
       
    32     0x009CEB00,
       
    33     0x0084C600,
       
    34     0x006BA200,
       
    35     0x00528200,
       
    36     0x00426100,
       
    37     0x00294100,
       
    38     0x00192800,
       
    39     0x00081000,
       
    40     0x00FEFEFE,
       
    41     0x009CCA31,
       
    42     0x00FFFFCE,
       
    43     0x00FEFEFE, // undefined
       
    44     0x00FEFEFE, // undefined
       
    45     0x00FEFEFE, // undefined
       
    46     0x00FEFEFE, // undefined
       
    47 	0x0000EEFF,		// coding yellow
       
    48 	0x000000DD,		// coding red
       
    49 	0x00FF7700,		// coding blue
       
    50 	0x0000EE00,		// coding green
       
    51     0x00339900,  // nokia brand color green 253
       
    52     0x00CC3300,  // nokia brand color blue 254
       
    53 	0x00DD00DD		// mask pink
       
    54 	};
       
    55 
       
    56 TRgb TPalette6::Color(int aIndex) const
       
    57 	{
       
    58 	// color rotation for palette
       
    59 	if (aIndex == 0)
       
    60 		return TRgb(0x00000000);
       
    61 	else if (aIndex == 0xff)
       
    62 		return TRgb(0x00ffffff);
       
    63 	else if (aIndex == 215)
       
    64 		return TRgb(0x00dd00dd);
       
    65 	else if (aIndex < StandardGrayBase)
       
    66 		{
       
    67 		return TRgb(KColorCubeMap[aIndex/36], KColorCubeMap[(aIndex/6)%6], KColorCubeMap[aIndex%6]);
       
    68 		}
       
    69 	else if (aIndex < SchemeSpecificColorBase)
       
    70 		{
       
    71 		int gray = aIndex - StandardGrayBase;
       
    72 		return TRgb(KStandardGray[gray], KStandardGray[gray], KStandardGray[gray]);
       
    73 		}
       
    74 	else
       
    75 		{
       
    76 		return TRgb(KPalette6[aIndex - SchemeSpecificColorBase]);
       
    77 		}
       
    78 	};
       
    79 
       
    80 // End of File