MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / accent

Function accent

source/matplot/util/colors.cpp:296–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294
295 namespace palette {
296 std::vector<std::vector<double>> accent(size_t n) {
297 static std::vector<std::vector<double>> map = {
298 {0.498039, 0.788235, 0.498039},
299 {0.745098, 0.682353, 0.831373},
300 {0.992157, 0.752941, 0.52549},
301 {1, 1, 0.6},
302 {0.219608, 0.423529, 0.690196},
303 {0.941176, 0.00784314, 0.498039},
304 {0.74902, 0.356863, 0.0901961},
305 {0.4, 0.4, 0.4}};
306 if (n == 8) {
307 return map;
308 }
309 std::vector<std::vector<double>> result;
310 for (size_t i = 0; i < n; ++i) {
311 std::array<float, 4> ac =
312 colormap_interpolation(static_cast<double>(i), 0.,
313 static_cast<double>(n - 1), map);
314 std::vector<double> vc = {ac[1], ac[2], ac[3]};
315 result.emplace_back(vc);
316 }
317 return result;
318 }
319 std::vector<std::vector<double>> blues(size_t n) {
320 static std::vector<std::vector<double>> map = {
321 {0.968627, 0.984314, 1},

Callers

nothing calls this directly

Calls 1

colormap_interpolationFunction · 0.85

Tested by

no test coverage detected