wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wColorComponent.hpp
Go to the documentation of this file.
1/*
2+---------------------------------------------------------------------------------------------------------------------------------------------------+
3Created by Wilfried Koch.
4Copyright @ 2025 Wilfried Koch. All rights reserved.
5+---------------------------------------------------------------------------------------------------------------------------------------------------+
6*/
7
8#ifndef W_COLOR_COMPONENT_HPP
9#define W_COLOR_COMPONENT_HPP
10
12
13#pragma GCC diagnostic push
14#pragma GCC diagnostic ignored "-Wfloat-equal"
15#pragma GCC diagnostic ignored "-Wswitch-default"
16#include <SFML/Graphics.hpp>
17#pragma GCC diagnostic pop
18
19namespace wEngine
20{
21
46 {
47 public:
52 ColorComponent( sf::Color color = sf::Color::Black );
53
54 /*
55 * @brief Virtual destructor.
56 */
57 virtual ~ColorComponent( ) = default;
58
63 [[nodiscard]] sf::Color getColor( ) const;
64
69 void setColor( sf::Color newColor );
70
74 void debugPrint( ) const;
75 private:
76 sf::Color mColor;
77 };
78
79}//End of namespace wEngine
80
81#endif
void setColor(sf::Color newColor)
Sets a new color.
Definition wColorComponent.cpp:34
ColorComponent(sf::Color color=sf::Color::Black)
Constructor with optional color.
Definition wColorComponent.cpp:17
virtual ~ColorComponent()=default
void debugPrint() const
Outputs the RGBA values of the color to standard output.
Definition wColorComponent.cpp:45
sf::Color getColor() const
Gets the current color.
Definition wColorComponent.cpp:29
Component()
Protected constructor to restrict instantiation to derived classes.
Definition wComponent.cpp:17
Definition wColorComponent.cpp:9