SteelSeries / gamesense-sdk

472 stars 146 forks source link

Gradient color based on range does not work. #80

Open gemboj opened 4 years ago

gemboj commented 4 years ago

SSE3 Version: 3.17.3 OS: Windows 10 Device: QCK Prism Cloth

What have I done: First I bind a JSON event with following body (color definition taken from official SDK documentation https://github.com/SteelSeries/gamesense-sdk/blob/master/doc/api/json-handlers-color.md#color-based-on-ranges):

{
    "game": "MY_TEST_GAME_5",
    "event": "MY_TEST_EVENT",
    "min_value": 0,
    "max_value": 100,
    "icon_id": 0,
    "handlers": 
    [
        {
            "device-type": "rgb-2-zone",
            "zone": "one",
            "color": [
                {
                    "low": 0,
                    "high": 10,
                    "color": {
                        "red": 255,
                        "green": 0,
                        "blue": 0
                    }
                },
                {
                    "low": 11,
                    "high": 100,
                    "color": {
                        "gradient": {
                            "zero": {
                                "red": 255,
                                "green": 0,
                                "blue": 0
                            },
                            "hundred": {
                                "red": 0,
                                "green": 255,
                                "blue": 0
                            }
                        }
                    }
                }
            ],
            "mode": "color"
        }
    ]
}

Then I send a series of events with body:

{
    "game": "MY_TEST_GAME_5",
    "event": "MY_TEST_EVENT",
    "data": {
        "value": XXX
    }
}

Where XXX is a value from range <0, 100>.

What did I expect: To see first zone of my pad to glow a static red color for values <1, 10> and then to glow a gradient for values <11, 100>.

What did happpen: First zone of my pad glow a static red color for values <1, 10> and then it goes dark for values <11, 100>.

What else did I try: I tried different combinations of color illumination settings and I concluded that only gradient in a range based color definition is broken. All other color definitions work as expected. For example:

Code that drops ranges altogether and just sets simple gradient definition does indeed work:

"color": {
    "gradient": {
        "zero": {
            "red": 255,
            "green": 0,
            "blue": 0
        },
        "hundred": {
            "red": 0,
            "green": 255,
            "blue": 0
        }
    }
},

But a single range of a gradient does not work (even though it should have same effect as the code above):

"color": [
    {
        "low": 0,
        "high": 100,
        "color": {
            "gradient": {
                "zero": {
                    "red": 255,
                    "green": 0,
                    "blue": 0
                },
                "hundred": {
                    "red": 0,
                    "green": 255,
                    "blue": 0
                }
            }
        }
    }
]
Guiguim255 commented 4 years ago

Same issue, didn't get any request error. SSE3 Version: 3.17.3 OS: Windows 10 Device: Rival 3 mouse