File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,9 @@ namespace colorutil
14
14
RGB srgb_color;
15
15
for (int i : {0 , 1 , 2 })
16
16
{
17
- srgb_color (i) =
18
- (linear_srgb_color (i) <= 0.0031308 ) ? linear_srgb_color (i) * 12.92 : std::pow ((linear_srgb_color (i) - 0.055 ) * 1.055 , 1 / 2.4 );
17
+ srgb_color (i) = (linear_srgb_color (i) <= 0.0031308 )
18
+ ? linear_srgb_color (i) * 12.92
19
+ : std::pow ((linear_srgb_color (i) - 0.055 ) * 1.055 , 1 / 2.4 );
19
20
}
20
21
return srgb_color;
21
22
}
Original file line number Diff line number Diff line change @@ -10,24 +10,28 @@ namespace colorutil
10
10
// / \brief RGB
11
11
// /
12
12
// / \details Each value is defined in [0, 1].
13
- class RGB : public Eigen ::Vector3d {
13
+ class RGB : public Eigen ::Vector3d
14
+ {
14
15
using Eigen::Vector3d::Vector3d;
15
16
};
16
17
17
18
// / \brief HSL
18
19
// /
19
20
// / \details Each value is defined in [0, 1].
20
- class HSL : public Eigen ::Vector3d {
21
+ class HSL : public Eigen ::Vector3d
22
+ {
21
23
using Eigen::Vector3d::Vector3d;
22
24
};
23
25
24
26
// / \brief CIEXYZ
25
- class XYZ : public Eigen ::Vector3d {
27
+ class XYZ : public Eigen ::Vector3d
28
+ {
26
29
using Eigen::Vector3d::Vector3d;
27
30
};
28
31
29
32
// / \brief CIELAB
30
- class Lab : public Eigen ::Vector3d {
33
+ class Lab : public Eigen ::Vector3d
34
+ {
31
35
using Eigen::Vector3d::Vector3d;
32
36
};
33
37
} // namespace colorutil
Original file line number Diff line number Diff line change 1
1
#include < color-util/HSL_to_RGB.hpp>
2
+ #include < color-util/Lab_to_XYZ.hpp>
2
3
#include < color-util/RGB_to_HSL.hpp>
3
4
#include < color-util/RGB_to_XYZ.hpp>
4
- #include < color-util/XYZ_to_RGB.hpp>
5
5
#include < color-util/XYZ_to_Lab.hpp>
6
- #include < color-util/Lab_to_XYZ .hpp>
6
+ #include < color-util/XYZ_to_RGB .hpp>
7
7
#include < iostream>
8
8
9
9
#if __cplusplus > 202000L
10
10
#include < format>
11
- #define FORMAT (x, ...) std::format(x __VA_OPT__ (,) __VA_ARGS__)
11
+ #define FORMAT (x, ...) std::format(x __VA_OPT__ (, ) __VA_ARGS__)
12
12
#else
13
13
#define FORMAT (x, y ) (std::string(x) + " ({} = " + std::to_string(y) + " )" )
14
14
#endif
You can’t perform that action at this time.
0 commit comments