|
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 KNokiaGrey[30] = |
|
23 { |
|
24 0x00F7F7F7, |
|
25 0x00EFEBEF, |
|
26 0x00DEDFDE, |
|
27 0x00CECECE, |
|
28 0x00BDBEBD, |
|
29 0x00ADAEAD, |
|
30 0x009C9A9C, |
|
31 0x008C8A8C, |
|
32 0x00737573, |
|
33 0x00636563, |
|
34 0x00525152, |
|
35 0x00424142, |
|
36 0x00313131, |
|
37 0x00212021, |
|
38 0x00101410, |
|
39 0x00080808, |
|
40 0x00FEFEFE, |
|
41 0x009C9E9C, |
|
42 0x00CED2CE, |
|
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 |
|
57 TRgb TNokiaGrey::Color(int aIndex) const |
|
58 { |
|
59 // color rotation for palette |
|
60 if (aIndex == 0) |
|
61 return TRgb(0x00000000); |
|
62 else if (aIndex == 0xff) |
|
63 return TRgb(0x00ffffff); |
|
64 else if (aIndex == 215) |
|
65 return TRgb(0x00dd00dd); |
|
66 else if (aIndex < StandardGrayBase) |
|
67 { |
|
68 return TRgb(KColorCubeMap[aIndex/36], KColorCubeMap[(aIndex/6)%6], KColorCubeMap[aIndex%6]); |
|
69 } |
|
70 else if (aIndex < SchemeSpecificColorBase) |
|
71 { |
|
72 int gray = aIndex - StandardGrayBase; |
|
73 return TRgb(KStandardGray[gray], KStandardGray[gray], KStandardGray[gray]); |
|
74 } |
|
75 else |
|
76 { |
|
77 return TRgb(KNokiaGrey[aIndex - SchemeSpecificColorBase]); |
|
78 } |
|
79 }; |
|
80 |
|
81 // End of File |