OGS
Color.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <array>
7#include <map>
8#include <string>
9
10namespace DataHolderLib
11{
12using Color = std::array<unsigned char, 4>;
13
14Color createColor(unsigned char r,
15 unsigned char g,
16 unsigned char b,
17 unsigned char a = 255);
18
21
24Color getColor(const std::string& id,
25 std::map<std::string, DataHolderLib::Color>& colors);
26
27} // namespace DataHolderLib
Color getRandomColor()
Returns a random RGB colour.
Definition Color.cpp:18
Color createColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Definition Color.cpp:10
Color getColor(const std::string &id, std::map< std::string, Color > &colors)
Definition Color.cpp:25
std::array< unsigned char, 4 > Color
Definition Color.h:12