<commit_before><?php

use MikeAlmond\Color\Color;
use MikeAlmond\Color\PaletteGenerator;

require __DIR__ . '/../vendor/autoload.php';

$baseColor     = Color::fromHex($_GET['color'] ?? 'C91414');
$generator = new PaletteGenerator($baseColor);


echo '<div style="float:left;margin:20px;">';

$palette   = $generator->triad($_GET['distance'] ?? 45);
array_push($palette, $baseColor->darken(20));

foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}



echo '</div><div style="float:left;margin:20px;">';


$palette   = $generator->monochromatic(3);
array_unshift($palette, $baseColor->adjustHue(180));
array_pop($palette);
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}

echo '</div><div style="float:left;margin:20px;">';

$palette   = [
    $baseColor,
    $baseColor->isDark() ? $baseColor->lighten(50) : $baseColor->darken(50),
    $baseColor->adjustHue(180),
    $baseColor->adjustHue(180)->isDark() ? $baseColor->adjustHue(180)->lighten(50) : $baseColor->adjustHue(180)->darken(50),
];
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}



echo '</div><div style="float:left;margin:20px;">';

$palette   = [
    $baseColor->adjustHue(180 - $_GET['distance'] ?? 45),
    $baseColor->adjustHue(180 - $_GET['distance'] ?? 45)->isDark() ? $baseColor->adjustHue(180 - $_GET['distance'] ?? 45)->lighten(50) : $baseColor->adjustHue(180)->darken(50),
    $baseColor,
    $baseColor->adjustHue(180 - $_GET['distance'] ?? 45)->isDark() ? $baseColor->adjustHue(180 - $_GET['distance'] ?? 45)->lighten(75) : $baseColor->adjustHue(180)->darken(75),
];
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}



echo '</div><div style="float:left;margin:20px;">';

$palette   = [
    $baseColor->adjustHue(180 + $_GET['distance'] ?? 45),
    $baseColor->adjustHue(180 + $_GET['distance'] ?? 45)->isDark() ? $baseColor->adjustHue(180 + $_GET['distance'] ?? 45)->lighten(50) : $baseColor->adjustHue(180 + $_GET['distance'] ?? 45)->darken(50),
    $baseColor,
    $baseColor->adjustHue(180 + $_GET['distance'] ?? 45)->isDark() ? $baseColor->adjustHue(180 + $_GET['distance'] ?? 45)->lighten(75) : $baseColor->adjustHue(180 + $_GET['distance'] ?? 45)->darken(75),
];
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}

echo '</div>';
<commit_msg>Adjust example theme generator<commit_after><?php

use MikeAlmond\Color\Color;
use MikeAlmond\Color\PaletteGenerator;

require __DIR__ . '/../vendor/autoload.php';

$baseColor = Color::fromHex($_GET['color'] ?? 'C91414');
$generator = new PaletteGenerator($baseColor);
$distance  = ($_GET['distance'] ?? 45);

echo '<div style="float:left;margin:20px;">';

$palette = $generator->triad($distance);
array_push($palette, $baseColor->darken(20));

foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}

echo '</div><div style="float:left;margin:20px;">';

$palette = $generator->monochromatic(3);
array_unshift($palette, $baseColor->adjustHue(180));
array_pop($palette);
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}

echo '</div><div style="float:left;margin:20px;">';

$palette = [
    $baseColor,
    $baseColor->isDark() ? $baseColor->lighten(50) : $baseColor->darken(50),
    $baseColor->adjustHue(180),
    $baseColor->adjustHue(180)->isDark() ? $baseColor->adjustHue(180)->lighten(50) : $baseColor->adjustHue(180)->darken(50),
];
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}

echo '</div><div style="float:left;margin:20px;">';

$palette = [
    $baseColor->adjustHue(180 - $distance),
    $baseColor->adjustHue(180 - $distance)->isDark() ? $baseColor->adjustHue(180 - $distance)->lighten(50) : $baseColor->adjustHue(180)->darken(50),
    $baseColor,
    $baseColor->adjustHue(180 - $distance)->isDark() ? $baseColor->adjustHue(180 - $distance)->lighten(75) : $baseColor->adjustHue(180)->darken(75),
];
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}

echo '</div><div style="float:left;margin:20px;">';

$palette = [
    $baseColor->adjustHue(180 + $distance),
    $baseColor->adjustHue(180 + $distance)->isDark() ? $baseColor->adjustHue(180 + $distance)->lighten(50) : $baseColor->adjustHue(180 + $distance)->darken(50),
    $baseColor,
    $baseColor->adjustHue(180 + $distance)->isDark() ? $baseColor->adjustHue(180 + $distance)->lighten(75) : $baseColor->adjustHue(180 + $distance)->darken(75),
];
foreach ($palette as $color) {
    print sprintf('<div style="background-color: #%s;width:200px;height:50px;color:#%s;">%s<br>%s</div>',
        $color->getHex(),
        $color->getMatchingTextColor()->getHex(),
        $color->getHex(),
        $color->getMatchingTextColor()->getHex()
    );
}

echo '</div>';

{'fraction_non_alphanumeric': 0.22960011804633318, 'fraction_numerical': 0.04072598494909252, 'mean_word_length': 4.783276450511946, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 193, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3468265', 'n_tokens_mistral': 2569, 'n_tokens_neox': 2386, 'n_words': 297}