prettypretty 0.12.0

Applying 2020s color science to 1970s terminal user interfaces
Documentation
use crate::spectrum::TabularDistribution;

/// The CIE D50 standard illuminant at 1nm resolution.
///
/// D50 represents (warm) daylight near sunrise or sunset. The data is directly
/// sourced from the [CIE](https://doi.org/10.25039/CIE.DS.etgmuqt5), covers the
/// spectrum from 300 to 830 nanometers (both inclusive), and is licensed under
/// [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
///
/// The values of standard illuminants are *not* unit-scaled. D50's maximum
/// value is 103.003.
pub static CIE_ILLUMINANT_D50: TabularDistribution = TabularDistribution::new(
    "D50",
    300, //..=830
    39484.934570,
    &[
        0.01922, 0.222348, 0.425476, 0.628604, 0.831732, 1.03486, 1.23799, 1.44112, 1.64424,
        1.84737, 2.0505, 2.62329, 3.19608, 3.76887, 4.34166, 4.91445, 5.48724, 6.06003, 6.63282,
        7.20561, 7.7784, 8.47531, 9.17222, 9.86913, 10.566, 11.263, 11.9599, 12.6568, 13.3537,
        14.0506, 14.7475, 15.0676, 15.3876, 15.7076, 16.0277, 16.3478, 16.6678, 16.9878, 17.3079,
        17.628, 17.948, 18.2542, 18.5603, 18.8665, 19.1727, 19.4788, 19.785, 20.0912, 20.3974,
        20.7035, 21.0097, 21.3029, 21.5961, 21.8894, 22.1826, 22.4758, 22.769, 23.0622, 23.3555,
        23.6487, 23.9419, 24.2438, 24.5457, 24.8475, 25.1494, 25.4513, 25.7532, 26.0551, 26.3569,
        26.6588, 26.9607, 26.7134, 26.4661, 26.2187, 25.9714, 25.7241, 25.4768, 25.2295, 24.9821,
        24.7348, 24.4875, 25.0258, 25.5641, 26.1024, 26.6407, 27.179, 27.7174, 28.2557, 28.794,
        29.3323, 29.8706, 31.8144, 33.7581, 35.7018, 37.6456, 39.5894, 41.5331, 43.4768, 45.4206,
        47.3644, 49.3081, 50.0286, 50.749, 51.4695, 52.19, 52.9104, 53.6309, 54.3514, 55.0719,
        55.7923, 56.5128, 56.8649, 57.217, 57.5691, 57.9212, 58.2733, 58.6254, 58.9775, 59.3296,
        59.6817, 60.0338, 59.8122, 59.5905, 59.3689, 59.1473, 58.9256, 58.704, 58.4824, 58.2608,
        58.0391, 57.8175, 59.5182, 61.219, 62.9197, 64.6205, 66.3212, 68.0219, 69.7227, 71.4234,
        73.1242, 74.8249, 76.0671, 77.3094, 78.5516, 79.7938, 81.036, 82.2783, 83.5205, 84.7627,
        86.005, 87.2472, 87.5837, 87.9202, 88.2567, 88.5932, 88.9297, 89.2662, 89.6027, 89.9392,
        90.2757, 90.6122, 90.6878, 90.7634, 90.839, 90.9146, 90.9902, 91.0657, 91.1413, 91.2169,
        91.2925, 91.3681, 91.7421, 92.1162, 92.4902, 92.8643, 93.2383, 93.6123, 93.9864, 94.3604,
        94.7345, 95.1085, 94.7939, 94.4793, 94.1648, 93.8502, 93.5356, 93.221, 92.9064, 92.5919,
        92.2773, 91.9627, 92.3388, 92.7149, 93.091, 93.4671, 93.8432, 94.2193, 94.5954, 94.9715,
        95.3476, 95.7237, 95.8127, 95.9016, 95.9906, 96.0795, 96.1685, 96.2575, 96.3464, 96.4354,
        96.5243, 96.6133, 96.6649, 96.7164, 96.768, 96.8196, 96.8712, 96.9227, 96.9743, 97.0259,
        97.0774, 97.129, 97.626, 98.123, 98.62, 99.117, 99.614, 100.111, 100.608, 101.105, 101.602,
        102.099, 101.965, 101.83, 101.696, 101.561, 101.427, 101.292, 101.158, 101.024, 100.889,
        100.755, 100.911, 101.067, 101.223, 101.38, 101.536, 101.692, 101.848, 102.005, 102.161,
        102.317, 102.085, 101.854, 101.622, 101.39, 101.158, 100.927, 100.695, 100.463, 100.232,
        100.0, 99.7735, 99.547, 99.3205, 99.094, 98.8675, 98.641, 98.4145, 98.188, 97.9615, 97.735,
        97.8533, 97.9716, 98.0899, 98.2082, 98.3265, 98.4448, 98.5631, 98.6814, 98.7997, 98.918,
        98.3761, 97.8342, 97.2922, 96.7503, 96.2084, 95.6665, 95.1246, 94.5826, 94.0407, 93.4988,
        93.9177, 94.3366, 94.7555, 95.1744, 95.5933, 96.0122, 96.4311, 96.85, 97.2689, 97.6878,
        97.8459, 98.0041, 98.1622, 98.3203, 98.4784, 98.6366, 98.7947, 98.9528, 99.111, 99.2691,
        99.2463, 99.2236, 99.2008, 99.1781, 99.1553, 99.1325, 99.1098, 99.087, 99.0643, 99.0415,
        98.7095, 98.3776, 98.0456, 97.7136, 97.3816, 97.0497, 96.7177, 96.3857, 96.0538, 95.7218,
        96.0353, 96.3489, 96.6624, 96.976, 97.2895, 97.603, 97.9166, 98.2301, 98.5437, 98.8572,
        98.5382, 98.2192, 97.9002, 97.5812, 97.2622, 96.9432, 96.6242, 96.3052, 95.9862, 95.6672,
        95.9195, 96.1717, 96.424, 96.6762, 96.9285, 97.1808, 97.433, 97.6853, 97.9375, 98.1898,
        98.6712, 99.1525, 99.6339, 100.115, 100.597, 101.078, 101.559, 102.041, 102.522, 103.003,
        102.616, 102.229, 101.842, 101.455, 101.068, 100.681, 100.294, 99.9071, 99.52, 99.133,
        97.9578, 96.7826, 95.6074, 94.4322, 93.257, 92.0817, 90.9065, 89.7313, 88.5561, 87.3809,
        87.8032, 88.2254, 88.6477, 89.0699, 89.4922, 89.9145, 90.3367, 90.759, 91.1812, 91.6035,
        91.732, 91.8605, 91.989, 92.1175, 92.246, 92.3746, 92.5031, 92.6316, 92.7601, 92.8886,
        91.2852, 89.6818, 88.0783, 86.4749, 84.8715, 83.2681, 81.6647, 80.0612, 78.4578, 76.8544,
        77.8201, 78.7858, 79.7514, 80.7171, 81.6828, 82.6485, 83.6142, 84.5798, 85.5455, 86.5112,
        87.1181, 87.7249, 88.3318, 88.9386, 89.5455, 90.1524, 90.7592, 91.3661, 91.9729, 92.5798,
        91.1448, 89.7098, 88.2748, 86.8398, 85.4048, 83.9699, 82.5349, 81.0999, 79.6649, 78.2299,
        76.1761, 74.1223, 72.0685, 70.0147, 67.9608, 65.907, 63.8532, 61.7994, 59.7456, 57.6918,
        60.2149, 62.738, 65.2612, 67.7843, 70.3074, 72.8305, 75.3536, 77.8768, 80.3999, 82.923,
        82.4581, 81.9932, 81.5283, 81.0634, 80.5985, 80.1336, 79.6687, 79.2038, 78.7389, 78.274,
        78.402, 78.5301, 78.6581, 78.7862, 78.9142, 79.0422, 79.1703, 79.2983, 79.4264, 79.5544,
        78.9391, 78.3238, 77.7085, 77.0932, 76.478, 75.8627, 75.2474, 74.6321, 74.0168, 73.4015,
        72.4534, 71.5052, 70.5571, 69.609, 68.6608, 67.7127, 66.7646, 65.8165, 64.8683, 63.9202,
        64.6059, 65.2916, 65.9772, 66.6629, 67.3486, 68.0343, 68.72, 69.4056, 70.0913, 70.777,
        71.1435, 71.5099, 71.8764, 72.2429, 72.6094, 72.9758, 73.3423, 73.7088, 74.0752, 74.4417,
    ],
);

// D65: 6504K, 2º: x = 0.31272, y = 0.32903; X = 95.047, Y = 100, Z = 108.883

/// The CIE D65 standard illuminant at 1nm resolution.
///
/// D65 represents daylight around noon. The data is directly sourced from the
/// [CIE](https://doi.org/10.25039/CIE.DS.hjfjmt59), covers the spectrum from
/// 300 to 830 nanometers (both inclusive), and is licensed under [CC BY-SA
/// 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
///
/// The values of standard illuminants are *not* unit-scaled. D50's maximum
/// value is 117.812.
pub static CIE_ILLUMINANT_D65: TabularDistribution = TabularDistribution::new(
    "D65",
    300, //..=830
    40852.20400,
    &[
        0.0341, 0.36014, 0.68618, 1.01222, 1.33826, 1.6643, 1.99034, 2.31638, 2.64242, 2.96846,
        3.2945, 4.98865, 6.6828, 8.37695, 10.0711, 11.7652, 13.4594, 15.1535, 16.8477, 18.5418,
        20.236, 21.9177, 23.5995, 25.2812, 26.963, 28.6447, 30.3265, 32.0082, 33.69, 35.3717,
        37.0535, 37.343, 37.6326, 37.9221, 38.2116, 38.5011, 38.7907, 39.0802, 39.3697, 39.6593,
        39.9488, 40.4451, 40.9414, 41.4377, 41.934, 42.4302, 42.9265, 43.4228, 43.9191, 44.4154,
        44.9117, 45.0844, 45.257, 45.4297, 45.6023, 45.775, 45.9477, 46.1203, 46.293, 46.4656,
        46.6383, 47.1834, 47.7285, 48.2735, 48.8186, 49.3637, 49.9088, 50.4539, 50.9989, 51.544,
        52.0891, 51.8777, 51.6664, 51.455, 51.2437, 51.0323, 50.8209, 50.6096, 50.3982, 50.1869,
        49.9755, 50.4428, 50.91, 51.3773, 51.8446, 52.3118, 52.7791, 53.2464, 53.7137, 54.1809,
        54.6482, 57.4589, 60.2695, 63.0802, 65.8909, 68.7015, 71.5122, 74.3229, 77.1336, 79.9442,
        82.7549, 83.628, 84.5011, 85.3742, 86.2473, 87.1204, 87.9936, 88.8667, 89.7398, 90.6129,
        91.486, 91.6806, 91.8752, 92.0697, 92.2643, 92.4589, 92.6535, 92.8481, 93.0426, 93.2372,
        93.4318, 92.7568, 92.0819, 91.4069, 90.732, 90.057, 89.3821, 88.7071, 88.0322, 87.3572,
        86.6823, 88.5006, 90.3188, 92.1371, 93.9554, 95.7736, 97.5919, 99.4102, 101.228, 103.047,
        104.865, 106.079, 107.294, 108.508, 109.722, 110.936, 112.151, 113.365, 114.579, 115.794,
        117.008, 117.088, 117.169, 117.249, 117.33, 117.41, 117.49, 117.571, 117.651, 117.732,
        117.812, 117.517, 117.222, 116.927, 116.632, 116.336, 116.041, 115.746, 115.451, 115.156,
        114.861, 114.967, 115.073, 115.18, 115.286, 115.392, 115.498, 115.604, 115.711, 115.817,
        115.923, 115.212, 114.501, 113.789, 113.078, 112.367, 111.656, 110.945, 110.233, 109.522,
        108.811, 108.865, 108.92, 108.974, 109.028, 109.082, 109.137, 109.191, 109.245, 109.3,
        109.354, 109.199, 109.044, 108.888, 108.733, 108.578, 108.423, 108.268, 108.112, 107.957,
        107.802, 107.501, 107.2, 106.898, 106.597, 106.296, 105.995, 105.694, 105.392, 105.091,
        104.79, 105.08, 105.37, 105.66, 105.95, 106.239, 106.529, 106.819, 107.109, 107.399,
        107.689, 107.361, 107.032, 106.704, 106.375, 106.047, 105.719, 105.39, 105.062, 104.733,
        104.405, 104.369, 104.333, 104.297, 104.261, 104.225, 104.19, 104.154, 104.118, 104.082,
        104.046, 103.641, 103.237, 102.832, 102.428, 102.023, 101.618, 101.214, 100.809, 100.405,
        100.0, 99.6334, 99.2668, 98.9003, 98.5337, 98.1671, 97.8005, 97.4339, 97.0674, 96.7008,
        96.3342, 96.2796, 96.225, 96.1703, 96.1157, 96.0611, 96.0065, 95.9519, 95.8972, 95.8426,
        95.788, 95.0778, 94.3675, 93.6573, 92.947, 92.2368, 91.5266, 90.8163, 90.1061, 89.3958,
        88.6856, 88.8177, 88.9497, 89.0818, 89.2138, 89.3459, 89.478, 89.61, 89.7421, 89.8741,
        90.0062, 89.9655, 89.9248, 89.8841, 89.8434, 89.8026, 89.7619, 89.7212, 89.6805, 89.6398,
        89.5991, 89.4091, 89.219, 89.029, 88.8389, 88.6489, 88.4589, 88.2688, 88.0788, 87.8887,
        87.6987, 87.2577, 86.8167, 86.3757, 85.9347, 85.4936, 85.0526, 84.6116, 84.1706, 83.7296,
        83.2886, 83.3297, 83.3707, 83.4118, 83.4528, 83.4939, 83.535, 83.576, 83.6171, 83.6581,
        83.6992, 83.332, 82.9647, 82.5975, 82.2302, 81.863, 81.4958, 81.1285, 80.7613, 80.394,
        80.0268, 80.0456, 80.0644, 80.0831, 80.1019, 80.1207, 80.1395, 80.1583, 80.177, 80.1958,
        80.2146, 80.4209, 80.6272, 80.8336, 81.0399, 81.2462, 81.4525, 81.6588, 81.8652, 82.0715,
        82.2778, 81.8784, 81.4791, 81.0797, 80.6804, 80.281, 79.8816, 79.4823, 79.0829, 78.6836,
        78.2842, 77.4279, 76.5716, 75.7153, 74.859, 74.0027, 73.1465, 72.2902, 71.4339, 70.5776,
        69.7213, 69.9101, 70.0989, 70.2876, 70.4764, 70.6652, 70.854, 71.0428, 71.2315, 71.4203,
        71.6091, 71.8831, 72.1571, 72.4311, 72.7051, 72.979, 73.253, 73.527, 73.801, 74.075,
        74.349, 73.0745, 71.8, 70.5255, 69.251, 67.9765, 66.702, 65.4275, 64.153, 62.8785, 61.604,
        62.4322, 63.2603, 64.0885, 64.9166, 65.7448, 66.573, 67.4011, 68.2293, 69.0574, 69.8856,
        70.4057, 70.9259, 71.446, 71.9662, 72.4863, 73.0064, 73.5266, 74.0467, 74.5669, 75.087,
        73.9376, 72.7881, 71.6387, 70.4893, 69.3398, 68.1904, 67.041, 65.8916, 64.7421, 63.5927,
        61.8752, 60.1578, 58.4403, 56.7229, 55.0054, 53.288, 51.5705, 49.8531, 48.1356, 46.4182,
        48.4569, 50.4956, 52.5344, 54.5731, 56.6118, 58.6505, 60.6892, 62.728, 64.7667, 66.8054,
        66.4631, 66.1209, 65.7786, 65.4364, 65.0941, 64.7518, 64.4096, 64.0673, 63.7251, 63.3828,
        63.4749, 63.567, 63.6592, 63.7513, 63.8434, 63.9355, 64.0276, 64.1198, 64.2119, 64.304,
        63.8188, 63.3336, 62.8484, 62.3632, 61.8779, 61.3927, 60.9075, 60.4223, 59.9371, 59.4519,
        58.7026, 57.9533, 57.204, 56.4547, 55.7054, 54.9562, 54.2069, 53.4576, 52.7083, 51.959,
        52.5072, 53.0553, 53.6035, 54.1516, 54.6998, 55.248, 55.7961, 56.3443, 56.8924, 57.4406,
        57.7278, 58.015, 58.3022, 58.5894, 58.8765, 59.1637, 59.4509, 59.7381, 60.0253, 60.3125,
    ],
);