25 lines
1010 B
Diff
25 lines
1010 B
Diff
Add missing cmath import in material-color-utilities
|
|
|
|
See: https://github.com/material-foundation/material-color-utilities/blob/main/cpp/palettes/tones.cc
|
|
|
|
--- a/third_party/material_color_utilities/src/cpp/palettes/tones.cc
|
|
+++ b/third_party/material_color_utilities/src/cpp/palettes/tones.cc
|
|
@@ -19,6 +19,8 @@
|
|
#include "cpp/cam/cam.h"
|
|
#include "cpp/cam/hct.h"
|
|
|
|
+#include <cmath>
|
|
+
|
|
namespace material_color_utilities {
|
|
|
|
TonalPalette::TonalPalette(Argb argb) : key_color_(0.0, 0.0, 0.0) {
|
|
@@ -67,7 +69,7 @@ Hct TonalPalette::createKeyColor(double hue, double chroma) {
|
|
// case where requested chroma is 16.51, and the closest chroma is 16.49.
|
|
// Error is minimized, but when rounded and displayed, requested chroma
|
|
// is 17, key color's chroma is 16.
|
|
- if (round(chroma) == round(smallest_delta_hct.get_chroma())) {
|
|
+ if (std::round(chroma) == std::round(smallest_delta_hct.get_chroma())) {
|
|
return smallest_delta_hct;
|
|
}
|
|
Hct hct_add(hue, chroma, start_tone + delta);
|