JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Alpha.hpp
Go to the documentation of this file.
1// Copyright 2024 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
5#pragma once
6
7#include <cstdint>
8
9namespace jngl {
11class Alpha {
12public:
16 explicit Alpha(float alpha);
17
18 static Alpha u8(uint8_t alpha);
19
21 [[nodiscard]] uint8_t u8() const;
22
24 float getAlpha() const;
26 void setAlpha(float);
27
28private:
29 float alpha;
30};
31
32} // namespace jngl
Object representing only the Alpha Channel in an RGBA color.
Definition: Alpha.hpp:11
uint8_t u8() const
0...255
float getAlpha() const
0.0f ... 1.0f
Alpha(float alpha)
void setAlpha(float)
0.0f ... 1.0f
JNGL's main namespace.
Definition: Achievement.hpp:10