codac 2.0.0
Loading...
Searching...
No Matches
codac2_StyleProperties.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <string>
13#include <set>
14#include "codac2_Color.h"
15
16namespace codac2
17{
18
26 {
27 Color stroke_color = Color::black();
28 Color fill_color = Color::none();
29 std::string line_style = "-";
30 std::string layer = "alpha";
31
38
46 StyleProperties(const Color& stroke_color, const std::string& param1 = "", const std::string& param2 = "");
47
55 StyleProperties(std::initializer_list<Color> colors, const std::string& param1 = "", const std::string& param2 = "");
56
61
66
71
75 static std::set<std::string> available_line_styles()
76 {
77 std::set<std::string> line_styles={"-", "--", "..", "-.", "-.."};
78 return line_styles;
79 };
80
81 };
82}
Color structure, in RGBA or HSVA format.
Definition codac2_Color.h:44
static Color black(float alpha=1.)
Black color.
Definition codac2_Color.h:162
static Color none()
Empty color (transparent white)
Definition codac2_Color.h:155
static std::set< std::string > available_line_styles()
Set of available line styles.
Definition codac2_StyleProperties.h:75
static StyleProperties inside()
Predefined "inside" style, dark gray edge and green fill.
static StyleProperties outside()
Predefined "outside" style, dark gray edge and cyan fill.
StyleProperties(std::initializer_list< Color > colors, const std::string &param1="", const std::string &param2="")
Constructor from a stroke and eventually a fill color, and two optional parameters.
StyleProperties()
Default constructor.
StyleProperties(const Color &stroke_color, const std::string &param1="", const std::string &param2="")
Constructor from a stroke color, and two optional parameters.
static StyleProperties boundary()
Predefined "boundary" style, dark gray edge and yellow fill.