/*!
 *
 * Copyright (c) 2019-2024 Diality Inc. - All Rights Reserved.
 * \copyright
 * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
 * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
 *
 * \file    Colors.qml
 * \author  (last)      Vy
 * \date    (last)      17-May-2023
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  17-Oct-2019
 *
 */

// Qt
pragma Singleton
import QtQuick 2.12

// Project
import Gui.Actions 0.1


/*!
 * \brief
 * Colors.qml file includes all the colors definitions
 * whcih is going to be used in the project
 */
QtObject {
    readonly property color red                             : "#c53b33"         // red
    readonly property color white                           : "white"           // white
    readonly property color transparent                     : "Transparent"     // No Color

    readonly property color separatorLine                   : "#5f809d"
    readonly property color backgroundMain                  : "#1A344D"
    readonly property color backgroundButtonNormal          : transparent
    readonly property color backgroundButtonSelect          : "#438FEB"
    readonly property color backgroundButtonSelectDark      : "#135088" // "#214773"
    readonly property color backgroundDialog                : "#254670"
    readonly property color backgroundMenu                  : "#14314C"
    readonly property color backgroundMainMenu              : "#0D2639"
    readonly property color backgroundDottedMenu            : "#64809D"
    readonly property color backgroundSlider                : "#195187"

    readonly property color sliderHighlightColor            : "orange"
    readonly property color sliderProgressBorderActive      : white

    readonly property color backgroundUltrafiltrationButton : "#31568F"
    readonly property color textValueUltrafiltrationButtonFg: "#98aec2"

    readonly property color backgroundRangeRect             : "#3e546e"
    readonly property color highlightProgressBar            : "#3d8eef"
    readonly property color highlightMedProgressBar         : "#1b2b3e"
    readonly property color textProgressBar                 : "#88a3c5"

    readonly property color textRangeMarker                 : white
    readonly property color rangeMarker                     : white
    readonly property color rangeMarkerShort                : "#9fb6d1"

    readonly property color textMain                        : "#FCFCFC"
    readonly property color textButton                      : "#FCFCFC" //"#E8E8E8"
    readonly property color textDisableButton               : "#607A91"
    readonly property color textTickMark                    : "#438FEB"
    readonly property color textInvalid                     : red

    readonly property color borderButton                    : "#4290EC"     //K:D //"#438FEB"
    readonly property color borderButtonHalfDarker          : Qt.darker(borderButton, 1.50)
    readonly property color borderButtonSelected            : "#db8f00"
    readonly property color borderButtonUnselected          : "#53667d"
    readonly property color borderDisableButton             : "#607A91"
    readonly property color boderSeparatorLine              : "#476982"
    readonly property color borderDialog                    : transparent // different colors for different displays // "#D01A344D" // "#D00F0F0F" //"#F51A344D"

    readonly property color touchTextAreaTitle              : "#a0b6d0"

    readonly property color textTextRectTitle               : white
    readonly property color textTextRectLabel               : "#e8e8e8"
    readonly property color textTextRectExtra               : "#708795"

    readonly property color line                            : "#094266"

    readonly property color pressuresText                   : white
    readonly property color pressuresArterialBar            : "#c568ed"
    readonly property color pressuresVenousBar              : "#31bcdb"
    readonly property color pressuresOutOfRangeBg           : red
    readonly property color pressureBorderActive            : "#cccccc" // this is the active border around the red

    readonly property color fluidText                       : white
    readonly property color fluidValue                      : white
    readonly property color fluidUnit                       : "#708795"

    readonly property color textNotificationNoneBg          : white
    readonly property color textNotificationNoneFg          : "#1b2b3e"

    readonly property color textNotificationLowBg           : "#f5a623"     // ?
    readonly property color textNotificationLowFg           : white         // ?

    readonly property color textNotificationMedBg           : "#f5a623"     // ?
    readonly property color textNotificationMedFg           : white         // ?

    readonly property color textNotificationHighBg          : red
    readonly property color textNotificationHighFg          : white

    readonly property color alarmTopBarHighBg               : "#831913"
    readonly property color alarmTopBarHighFg               : white

    readonly property color alarmTopBarMedBg                : "#db8f00"
    readonly property color alarmTopBarMedFg                : white

    readonly property color alarmTopBarLowBg                : "#db8f00"
    readonly property color alarmTopBarLowFg                : white

    readonly property color alarmTopBarNoneBg               : "#db8f00"
    readonly property color alarmTopBarNoneFg               : white

    readonly property color createTrProfileID               : "#ffbb44"

    readonly property color createTreatmentActive           : "#3d8eef"
    readonly property color createTreatmentInactive         : backgroundRangeRect
    readonly property color createTreatmentNotReady         : "#1f4974"
    readonly property color createTreatmentReady            : "#438FEB"
    readonly property color createTreatmentTextNotReady     : "#507090"
    readonly property color createTreatmentTextReady        : white
    readonly property color createTreatmentInvalidParam     : red

    readonly property color scrollBarBgColor                : white //"#80696969" // half transparent dimgray

    // ---------- < PRS > Related Section ----------
    // Alarm priority colors
    function alarmPriorityColors(vPriority) {
        let titleBg   = ""
        let titleFg   = ""
        let contentBg = ""
        let contentFg = ""
        switch (vPriority) {
        case GuiActions.ALARM_PRIORITY_HIGH:
            titleBg   = alarmTopBarHighBg
            titleFg   = alarmTopBarHighFg
            contentBg = textNotificationHighBg
            contentFg = textNotificationHighFg
            break
        case GuiActions.ALARM_PRIORITY_MEDIUM:
            titleBg   = alarmTopBarMedBg
            titleFg   = alarmTopBarMedFg
            contentBg = textNotificationMedBg
            contentFg = textNotificationMedFg
            break
        case GuiActions.ALARM_PRIORITY_LOW:
            titleBg   = alarmTopBarLowBg
            titleFg   = alarmTopBarLowFg
            contentBg = textNotificationLowBg
            contentFg = textNotificationLowFg
            break
        default : // GuiActions.ALARM_PRIORITY_NONE
            titleBg   = backgroundButtonSelect
            titleFg   = textMain
            contentBg = backgroundDialog
            contentFg = textMain
        }
        return [titleBg   ,
                titleFg   ,
                contentBg ,
                contentFg ]
    }
}
