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

Function greys

source/matplot/util/colors.cpp:512–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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},
515 {0.941176, 0.941176, 0.941176},
516 {0.85098, 0.85098, 0.85098},
517 {0.741176, 0.741176, 0.741176},
518 {0.588235, 0.588235, 0.588235},
519 {0.45098, 0.45098, 0.45098},
520 {0.321569, 0.321569, 0.321569},
521 {0.145098, 0.145098, 0.145098}};
522 if (n == 8) {
523 return map;
524 }
525 std::vector<std::vector<double>> result;
526 for (size_t i = 0; i < n; ++i) {
527 std::array<float, 4> ac =
528 colormap_interpolation(static_cast<double>(i), 0.,
529 static_cast<double>(n - 1), map);
530 std::vector<double> vc = {ac[1], ac[2], ac[3]};
531 result.emplace_back(vc);
532 }
533 return result;
534 }
535 std::vector<std::vector<double>> inferno(size_t n) {
536 static std::vector<std::vector<double>> map = {
537 {0.001462, 0.000466, 0.013866}, {0.002267, 0.00127, 0.01857},

Callers

nothing calls this directly

Calls 1

colormap_interpolationFunction · 0.85

Tested by

no test coverage detected