LibreOffice Module svx (master)  1
ColorSets.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  */
10 
11 #include <svx/ColorSets.hxx>
12 
13 namespace svx
14 {
15 
16 ColorSet::ColorSet(OUString const & aColorSetName)
17  : maColorSetName(aColorSetName)
18  , maColors(12)
19 {}
20 
22 {}
23 
25 {}
26 
28 {
29  {
30  ColorSet aColorSet("Breeze");
31  aColorSet.add(0, 0x232629);
32  aColorSet.add(1, 0xFCFCFC);
33  aColorSet.add(2, 0x31363B);
34  aColorSet.add(3, 0xEFF0F1);
35  aColorSet.add(4, 0xDA4453);
36  aColorSet.add(5, 0xF47750);
37  aColorSet.add(6, 0xFDBC4B);
38  aColorSet.add(7, 0xC9CE3B);
39  aColorSet.add(8, 0x1CDC9A);
40  aColorSet.add(9, 0x2ECC71);
41  aColorSet.add(10, 0x1D99F3);
42  aColorSet.add(11, 0x3DAEE9);
43  maColorSets.push_back(aColorSet);
44  }
45  {
46  ColorSet aColorSet("Material Blue");
47  aColorSet.add(0, 0x212121);
48  aColorSet.add(1, 0xFFFFFF);
49  aColorSet.add(2, 0x37474F);
50  aColorSet.add(3, 0xECEFF1);
51  aColorSet.add(4, 0x7986CB);
52  aColorSet.add(5, 0x303F9F);
53  aColorSet.add(6, 0x64B5F6);
54  aColorSet.add(7, 0x1976D2);
55  aColorSet.add(8, 0x4FC3F7);
56  aColorSet.add(9, 0x0277BD);
57  aColorSet.add(10, 0x4DD0E1);
58  aColorSet.add(11, 0x0097A7);
59  maColorSets.push_back(aColorSet);
60  }
61  {
62  ColorSet aColorSet("Material Red");
63  aColorSet.add(0, 0x212121);
64  aColorSet.add(1, 0xFFFFFF);
65  aColorSet.add(2, 0x424242);
66  aColorSet.add(3, 0xF5F5F5);
67  aColorSet.add(4, 0xFF9800);
68  aColorSet.add(5, 0xFF6D00);
69  aColorSet.add(6, 0xFF5722);
70  aColorSet.add(7, 0xDD2C00);
71  aColorSet.add(8, 0xF44336);
72  aColorSet.add(9, 0xD50000);
73  aColorSet.add(10, 0xE91E63);
74  aColorSet.add(11, 0xC51162);
75  maColorSets.push_back(aColorSet);
76  }
77  {
78  ColorSet aColorSet("Material Green");
79  aColorSet.add(0, 0x212121);
80  aColorSet.add(1, 0xFFFFFF);
81  aColorSet.add(2, 0x424242);
82  aColorSet.add(3, 0xF5F5F5);
83  aColorSet.add(4, 0x009688);
84  aColorSet.add(5, 0x00bfa5);
85  aColorSet.add(6, 0x4caf50);
86  aColorSet.add(7, 0x00c853);
87  aColorSet.add(8, 0x8bc34a);
88  aColorSet.add(9, 0x64dd17);
89  aColorSet.add(10, 0xcddc39);
90  aColorSet.add(11, 0xaeea00);
91  maColorSets.push_back(aColorSet);
92  }
93 }
94 
95 const ColorSet& ColorSets::getColorSet(const OUString& rName)
96 {
97  for (const ColorSet & rColorSet : maColorSets)
98  {
99  if (rColorSet.getName() == rName)
100  return rColorSet;
101  }
102  return maColorSets[0];
103 }
104 
105 } // end of namespace svx
106 
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void add(sal_uInt32 nIndex, sal_uInt32 aColorData)
Definition: ColorSets.hxx:31
const ColorSet & getColorSet(sal_uInt32 nIndex)
Definition: ColorSets.hxx:59
std::vector< ColorSet > maColorSets
Definition: ColorSets.hxx:48
ColorSet(OUString const &aName)
Definition: ColorSets.cxx:16