File: ColorPool.h

package info (click to toggle)
structure-synth 1.5.0-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,268 kB
  • ctags: 1,966
  • sloc: cpp: 10,209; python: 164; makefile: 71; sh: 15
file content (27 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <QColor>
#include <QString>
#include <QVector>
#include <QImage>

namespace StructureSynth {
	namespace Model {	

		/// A ColorPool is a set or colors. It is used for drawing random colors using the 'color random' operator.
		/// The Builder maintainse single color pool in a project.
		class ColorPool  {
			enum PoolType { RandomHue, GreyScale, RandomRGB, Picture, ColorList };
		public:
			ColorPool(QString initString);
			~ColorPool();
			QColor drawColor(); // returns a random color from the pool (in HSV)
		private:
			PoolType type;
			QVector<QColor> colorList; // only used by type: ColorList.
			QImage* picture; // Only used by type: Picture.
		};

	}
}