delVhariant / illumination

Small Module for Foundry VTT that ties Global Illumination to the scene Darkness level.
MIT License
3 stars 5 forks source link

Can't set a custom scene darkness from the "Set to Custom" option #34

Open Derinzed opened 2 years ago

Derinzed commented 2 years ago

I was able to solve the issue by converting the level to a float in the scene update call like so:

    canvas.scene.update({"darkness": parseFloat(level)}, {animateDarkness: true}).then(() => {
            interpolateSceneColor(color)
        });

and

canvas.scene.update({"darkness": parseFloat(level)}, {animateDarkness: false}).then(() => {
        SendColorChange(color);
    });

I don't know if this is the optimal solution, but it does work.