/**
 * Copyright (c) Enalean, 2021-Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

@use "sass:color";
@use "pkg:@tuleap/project-background";

@each $project-color-name, $project-color-properties in project-background.$definitions {
    $project-color: project-background.get-color($project-color-name);

    .project-color-#{$project-color-name} {
        --project-color: #{$project-color};
        --project-color-background: #{color.change($project-color, $alpha: 0.07)};
        --project-color-background-gradient: linear-gradient(
                #{color.adjust($project-color, $alpha: - 0.97),
                color.adjust($project-color, $alpha: - 0.97)}
            ),
            linear-gradient(var(--tlp-white-color), var(--tlp-white-color));
        --project-color-background-gradient-light: linear-gradient(
                #{color.adjust($project-color, $alpha: - 0.95),
                color.adjust($project-color, $alpha: - 0.95)}
            ),
            linear-gradient(var(--tlp-white-color), var(--tlp-white-color));
        --project-color-background-gradient-light-hover: linear-gradient(
                #{color.adjust($project-color, $alpha: - 0.95, $lightness: - 2%),
                color.adjust($project-color, $alpha: - 0.95, $lightness: - 2%)}
            ),
            linear-gradient(
                color.adjust(#ffffff, $lightness: - 2%),
                color.adjust(#ffffff, $lightness: - 2%)
            );
        --project-color-border: #{color.adjust($project-color, $alpha: - 0.9)};
        --project-color-border-light: #{color.adjust($project-color, $alpha: - 0.8)};
    }
}
