// ============================================================================
// Poster
// ============================================================================

////
///
/// PAttern Functions Module
/// ===========================================================================
///
///
/// @group Pattern
/// @author Scape Agency
/// @link https://hue.gl
/// @since 0.1.0 initial release
/// @todo None
/// @access public
///
////


// ============================================================================
// Use
// ============================================================================

@use "sass:math";

@use "../variables" as *;
@use "../maps" as *;

// ============================================================================
// Functions
// ============================================================================



///
/// Striped Background Generator
/// ---------------------------------------------------------------------------
///
/// Generates a striped background pattern using two colors from the color map.
/// @name hue_striped_background
/// @param {String} $color_name1 - The name of the first color.
/// @param {String} $color_name2 - The name of the second color.
/// @param {Number} $stripe_width [10px] - Width of each stripe.
/// @return {Gradient} - A CSS gradient representing the striped pattern.
///
/// @example scss - Using striped background generator
///   .element {
///     background-image: hue_striped_background('primary', 'secondary');
///   }
///
@function hue_striped_background(
    $color_name1,
    $color_name2,
    $stripe_width: 10px
) {
    $color1: hue_color($color_name1);
    $color2: hue_color($color_name2);

    @if type-of($color1) != 'color' or type-of($color2) != 'color' {
        @warn "One or both specified colors could not be found.";
        @return null;
    }

    @return repeating-linear-gradient(
        45deg,
        $color1,
        $color1 $stripe_width,
        $color2 $stripe_width,
        $color2 $stripe_width * 2
    );
}
