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

Function greens

source/matplot/util/colors.cpp:493–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491 return result;
492 }
493 std::vector<std::vector<double>> greens(size_t n) {
494 static std::vector<std::vector<double>> map = {
495 {0.968627, 0.988235, 0.960784}, {0.898039, 0.960784, 0.878431},
496 {0.780392, 0.913725, 0.752941}, {0.631373, 0.85098, 0.607843},
497 {0.454902, 0.768627, 0.462745}, {0.254902, 0.670588, 0.364706},
498 {0.137255, 0.545098, 0.270588}, {0, 0.352941, 0.196078}};
499 if (n == 8) {
500 return map;
501 }
502 std::vector<std::vector<double>> result;
503 for (size_t i = 0; i < n; ++i) {
504 std::array<float, 4> ac =
505 colormap_interpolation(static_cast<double>(i), 0.,
506 static_cast<double>(n - 1), map);
507 std::vector<double> vc = {ac[1], ac[2], ac[3]};
508 result.emplace_back(vc);
509 }
510 return result;
511 }
512 std::vector<std::vector<double>> greys(size_t n) {
513 static std::vector<std::vector<double>> map = {
514 {1, 1, 1},

Callers 1

mainFunction · 0.85

Calls 1

colormap_interpolationFunction · 0.85

Tested by

no test coverage detected