@use "sass:map";
// Color Array
$colors: (
    "primary": var(--dnn-color-primary, #00a5e0),
    "primary-r": var(--dnn-color-primary-r, 0),
    "primary-g": var(--dnn-color-primary-g, 165),
    "primary-b": var(--dnn-color-primary-b, 224),
    "primary-light": var(--dnn-color-primary-light, #1aaee3),
    "primary-light-r": var(--dnn-color-primary-light-r, 26),
    "primary-light-g": var(--dnn-color-primary-light-g, 174),
    "primary-light-b": var(--dnn-color-primary-light-b, 227),
    "primary-dark": var(--dnn-color-primary-dark, #0091c5),
    "primary-dark-r": var(--dnn-color-primary-dark-r, 0),
    "primary-dark-g": var(--dnn-color-primary-dark-g, 145),
    "primary-dark-b": var(--dnn-color-primary-dark-b 197),
    "primary-contrast": var(--dnn-color-primary-contrast, #ffffff),
    "primary-contrast-r": var(--dnn-color-primary-contrast-r, 255),
    "primary-contrast-g": var(--dnn-color-primary-contrast-g, 255),
    "primary-contrast-b": var(--dnn-color-primary-contrast-b 255),

    "secondary": var(--dnn-color-secondary, #ed3d46),
    "secondary-r": var(--dnn-color-secondary-r, 237),
    "secondary-g": var(--dnn-color-secondary-g, 61),
    "secondary-b": var(--dnn-color-secondary-b, 70),
    "secondary-light": var(--dnn-color-secondary-light, #ef5059),
    "secondary-light-r": var(--dnn-color-secondary-light-r, 239),
    "secondary-light-g": var(--dnn-color-secondary-light-g, 80),
    "secondary-light-b": var(--dnn-color-secondary-light-b, 89),
    "secondary-dark": var(--dnn-color-secondary-dark, #d1363e),
    "secondary-dark-r": var(--dnn-color-secondary-dark-r, 209),
    "secondary-dark-g": var(--dnn-color-secondary-dark-g, 54),
    "secondary-dark-b": var(--dnn-color-secondary-dark-b, 62),
    "secondary-contrast": var(--dnn-color-secondary-contrast, #ffffff),
    "secondary-contrast-r": var(--dnn-color-secondary-contrast-r, 255),
    "secondary-contrast-g": var(--dnn-color-secondary-contrast-g, 255),
    "secondary-contrast-b": var(--dnn-color-secondary-contrast-b, 255),

    "tertiary": var(--dnn-color-tertiary, #0e2936),
    "tertiary-r": var(--dnn-color-tertiary-r, 14),
    "tertiary-g": var(--dnn-color-tertiary-g, 41),
    "tertiary-b": var(--dnn-color-tertiary-b, 54),
    "tertiary-light": var(--dnn-color-tertiary-light, #3c7a9a),
    "tertiary-light-r": var(--dnn-color-tertiary-light-r, 60),
    "tertiary-light-g": var(--dnn-color-tertiary-light-g, 122),
    "tertiary-light-b": var(--dnn-color-tertiary-light-b, 154),
    "tertiary-dark": var(--dnn-color-tertiary-dark, #0b1c24),
    "tertiary-dark-r": var(--dnn-color-tertiary-dark-r, 11),
    "tertiary-dark-g": var(--dnn-color-tertiary-dark-g, 28),
    "tertiary-dark-b": var(--dnn-color-tertiary-dark-b, 36),
    "tertiary-contrast": var(--dnn-color-tertiary-contrast, #ffffff),
    "tertiary-contrast-r": var(--dnn-color-tertiary-contrast-r, 255),
    "tertiary-contrast-g": var(--dnn-color-tertiary-contrast-g, 255),
    "tertiary-contrast-b": var(--dnn-color-tertiary-contrast-b, 255),
    
    "neutral": var(--dnn-color-neutral, #ededee),
    "neutral-r": var(--dnn-color-neutral-r, 245),
    "neutral-g": var(--dnn-color-neutral-g, 245),
    "neutral-b": var(--dnn-color-neutral-b, 245),
    "neutral-light": var(--dnn-color-neutral-light, #ffffff),
    "neutral-light-r": var(--dnn-color-neutral-light-r, 255),
    "neutral-light-g": var(--dnn-color-neutral-light-g, 255),
    "neutral-light-b": var(--dnn-color-neutral-light-b, 255),
    "neutral-dark": var(--dnn-color-neutral-dark, #999999),
    "neutral-dark-r": var(--dnn-color-neutral-dark-r, 153),
    "neutral-dark-g": var(--dnn-color-neutral-dark-g, 153),
    "neutral-dark-b": var(--dnn-color-neutral-dark-b, 153),
    "neutral-contrast": var(--dnn-color-neutral-contrast, #000000),
    "neutral-contrast-r": var(--dnn-color-neutral-contrast-r, 0),
    "neutral-contrast-g": var(--dnn-color-neutral-contrast-g, 0),
    "neutral-contrast-b": var(--dnn-color-neutral-contrast-b, 0),

    "background": var(--dnn-color-background, #ffffff),
    "background-r": var(--dnn-color-background-r, 255),
    "background-g": var(--dnn-color-background-g, 255),
    "background-b": var(--dnn-color-background-b, 255),
    "background-light": var(--dnn-color-background-light, #f5f5f5),
    "background-light-r": var(--dnn-color-background-light-r, 245),
    "background-light-g": var(--dnn-color-background-light-g, 245),
    "background-light-b": var(--dnn-color-background-light-b, 245),
    "background-dark": var(--dnn-color-background-dark, #cccccc),
    "background-dark-r": var(--dnn-color-background-dark-r, 204),
    "background-dark-g": var(--dnn-color-background-dark-g, 204),
    "background-dark-b": var(--dnn-color-background-dark-b, 204),
    "background-contrast": var(--dnn-color-background-contrast, #000000),
    "background-contrast-r": var(--dnn-color-background-contrast-r, 0),
    "background-contrast-g": var(--dnn-color-background-contrast-g, 0),
    "background-contrast-b": var(--dnn-color-background-contrast-b, 0),

    "foreground": var(--dnn-color-foreground, #000000),
    "foreground-r": var(--dnn-color-foreground-r, 0),
    "foreground-g": var(--dnn-color-foreground-g, 0),
    "foreground-b": var(--dnn-color-foreground-b, 0),
    "foreground-light": var(--dnn-color-foreground-light, #333333),
    "foreground-light-r": var(--dnn-color-foreground-light-r, 51),
    "foreground-light-g": var(--dnn-color-foreground-light-g, 51),
    "foreground-light-b": var(--dnn-color-foreground-light-b, 51),
    "foreground-dark": var(--dnn-color-foreground-dark, #000000),
    "foreground-dark-r": var(--dnn-color-foreground-dark-r, 0),
    "foreground-dark-g": var(--dnn-color-foreground-dark-g, 0),
    "foreground-dark-b": var(--dnn-color-foreground-dark-b, 0),
    "foreground-contrast": var(--dnn-color-foreground-contrast, #ffffff),
    "foreground-contrast-r": var(--dnn-color-foreground-contrast-r, 255),
    "foreground-contrast-g": var(--dnn-color-foreground-contrast-g, 255),
    "foreground-contrast-b": var(--dnn-color-foreground-contrast-b, 255),

    "surface": var(--dnn-color-surface, #eeeeee),
    "surface-r": var(--dnn-color-surface-r, 238),
    "surface-g": var(--dnn-color-surface-g, 238),
    "surface-b": var(--dnn-color-surface-b, 238),
    "surface-light": var(--dnn-color-surface-light, #f5f5f5),
    "surface-light-r": var(--dnn-color-surface-light-r, 245),
    "surface-light-g": var(--dnn-color-surface-light-g, 245),
    "surface-light-b": var(--dnn-color-surface-light-b, 245),
    "surface-dark": var(--dnn-color-surface-dark, #cccccc),
    "surface-dark-r": var(--dnn-color-surface-dark-r, 204),
    "surface-dark-g": var(--dnn-color-surface-dark-g, 204),
    "surface-dark-b": var(--dnn-color-surface-dark-b, 204),
    "surface-contrast": var(--dnn-color-surface-contrast, #000000),
    "surface-contrast-r": var(--dnn-color-surface-contrast-r, 0),
    "surface-contrast-g": var(--dnn-color-surface-contrast-g, 0),
    "surface-contrast-b": var(--dnn-color-surface-contrast-b, 0),

    "info": var(--dnn-color-info, #17a2b8),
    "info-r": var(--dnn-color-info-r, 23),
    "info-g": var(--dnn-color-info-g, 162),
    "info-b": var(--dnn-color-info-b, 184),
    "info-light": var(--dnn-color-info-light, #23b8cf),
    "info-light-r": var(--dnn-color-info-light-r, 35),
    "info-light-g": var(--dnn-color-info-light-g, 184),
    "info-light-b": var(--dnn-color-info-light-b, 207),
    "info-dark": var(--dnn-color-info-dark, #00889e),
    "info-dark-r": var(--dnn-color-info-dark-r, 0),
    "info-dark-g": var(--dnn-color-info-dark-g, 136),
    "info-dark-b": var(--dnn-color-info-dark-b, 158),
    "info-contrast": var(--dnn-color-info-contrast, #ffffff),
    "info-contrast-r": var(--dnn-color-info-contrast-r, 255),
    "info-contrast-g": var(--dnn-color-info-contrast-g, 255),
    "info-contrast-b": var(--dnn-color-info-contrast-b, 255),
    
    "success": var(--dnn-color-success, #28a745),
    "success-r": var(--dnn-color-success-r, 40),
    "success-g": var(--dnn-color-success-g, 167),
    "success-b": var(--dnn-color-success-b, 69),
    "success-light": var(--dnn-color-success-light, #49c25d),
    "success-light-r": var(--dnn-color-success-light-r, 73),
    "success-light-g": var(--dnn-color-success-light-g, 194),
    "success-light-b": var(--dnn-color-success-light-b, 93),
    "success-dark": var(--dnn-color-success-dark, #00902f),
    "success-dark-r": var(--dnn-color-success-dark-r, 0),
    "success-dark-g": var(--dnn-color-success-dark-g, 144),
    "success-dark-b": var(--dnn-color-success-dark-b, 47),
    "success-contrast": var(--dnn-color-success-contrast, #ffffff),
    "success-contrast-r": var(--dnn-color-success-contrast-r, 255),
    "success-contrast-g": var(--dnn-color-success-contrast-g, 255),
    "success-contrast-b": var(--dnn-color-success-contrast-b, 255),

    "warning": var(--dnn-color-warning, #ffc107),
    "warning-r": var(--dnn-color-warning-r, 255),
    "warning-g": var(--dnn-color-warning-g, 193),
    "warning-b": var(--dnn-color-warning-b, 7),
    "warning-light": var(--dnn-color-warning-light, #ffd42e),
    "warning-light-r": var(--dnn-color-warning-light-r, 255),
    "warning-light-g": var(--dnn-color-warning-light-g, 212),
    "warning-light-b": var(--dnn-color-warning-light-b, 46),
    "warning-dark": var(--dnn-color-warning-dark, #e9ad00),
    "warning-dark-r": var(--dnn-color-warning-dark-r, 233),
    "warning-dark-g": var(--dnn-color-warning-dark-g, 173),
    "warning-dark-b": var(--dnn-color-warning-dark-b, 0),
    "warning-contrast": var(--dnn-color-warning-contrast, #ffffff),
    "warning-contrast-r": var(--dnn-color-warning-contrast-r, 255),
    "warning-contrast-g": var(--dnn-color-warning-contrast-g, 255),
    "warning-contrast-b": var(--dnn-color-warning-contrast-b, 255),

    "danger": var(--dnn-color-danger, #dc3545),
    "danger-r": var(--dnn-color-danger-r, 220),
    "danger-g": var(--dnn-color-danger-g, 53),
    "danger-b": var(--dnn-color-danger-b, 69),
    "danger-light": var(--dnn-color-danger-light, #f14954),
    "danger-light-r": var(--dnn-color-danger-light-r, 241),
    "danger-light-g": var(--dnn-color-danger-light-g, 73),
    "danger-light-b": var(--dnn-color-danger-light-b, 84),
    "danger-dark": var(--dnn-color-danger-dark, #c51535),
    "danger-dark-r": var(--dnn-color-danger-dark-r, 197),
    "danger-dark-g": var(--dnn-color-danger-dark-g, 21),
    "danger-dark-b": var(--dnn-color-danger-dark-b, 53),
    "danger-contrast": var(--dnn-color-danger-contrast, #ffffff),
    "danger-contrast-r": var(--dnn-color-danger-contrast-r, 255),
    "danger-contrast-g": var(--dnn-color-danger-contrast-g, 255),
    "danger-contrast-b": var(--dnn-color-danger-contrast-b, 255),
    
    "variation-opacity": var(--dnn-color-variation-opacity, 0.8),
);


// Color function
@function color($color-name, $rgb: false) {
    @if($rgb) {
        @return var(--dnn-color-#{$color-name}-r) + ', ' + var(--dnn-color-#{$color-name}-g) + ', ' + var(--dnn-color-#{$color-name}-b);
    } @else {
        @return map.get($colors, $color-name);
    }
}
