Ambient light will also affect the result.
Not necessarily because the ambient light would affect the screen shows (it's emissive, not reflective) but because the brain also does "auto white/colour balance".
For a fun experiment, get your hand on some heavily yellow-tinted party glasses, go outside on a clear day with a bright blue sky.
When you put them on everything will be stark yellow tinged (and the blue sky will be completely off, like green or pink, can't recall which) but after a little while going on your business, perception adjusts and only a much less dramatic yellowish veil is in effect. You'd look at the sky and see almost-blue.
The kicker is when you remove the glasses: the sky will suddenly be of a glorious pink! (or green, can't recall) Only moments later it'll adjust back to be blue.
A certain wavelength may be absolute blue of a certain kind, but the perceptual system is all relative: "wait, I know this sky should be blue because that's what I've always seen, so let's compensate".
The same kind of effect - although less dramatic - can be achieved with lights that can be adjusted from say 2400K to 6500K and having as reference an object that is known "pure white", like a A4/letter sheet of paper.
This effect, in turn, adjusts how "absolutely displayed" colours are identified by way of biasing the whole perceptive system. AIUI that's the rationale behind Apple's True Tone thingy, aiming to compensate for that.