gfxtools/Color/src/Palette5.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 KPalette5[30] =
       
    23 	{
       
    24     0x00EFFFF7,
       
    25     0x00D6FFEF,
       
    26     0x00BDFFDE,
       
    27     0x009CFFCE,
       
    28     0x007BFFBD,
       
    29     0x005AFFAD,
       
    30     0x003AFF9C,
       
    31     0x0010FF8C,
       
    32     0x0000EB73,
       
    33     0x0000C663,
       
    34     0x0000A252,
       
    35     0x00008242,
       
    36     0x00006131,
       
    37     0x00004121,
       
    38     0x00002810,
       
    39     0x00001008,
       
    40     0x00FEFEFE,
       
    41     0x0000CA63,
       
    42     0x0063FFAD,
       
    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 TPalette5::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(KPalette5[aIndex - SchemeSpecificColorBase]);
       
    77 		}
       
    78 	};
       
    79 
       
    80 // End of File