How to access Post Processing at runtime?

I’m trying to add a brightness/gamma slider. I’ve succeeded in modifying the values, but it doesn’t actually change the game’s brightness. Based on what I’ve read, it sounds like there may be an instance that I’m not actually grabbing? Here’s the code I’m using right now:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
 
 
public class UserSettings : MonoBehaviour
{
    private UnityEngine.Rendering.VolumeProfile volumeProfile;
    private UnityEngine.Rendering.HighDefinition.LiftGammaGain gamma;
 
    private void Start()
    {
        volumeProfile = GetComponent<UnityEngine.Rendering.Volume>()?.profile;
        if (!volumeProfile) throw new System.NullReferenceException(nameof(UnityEngine.Rendering.VolumeProfile));
        if (!volumeProfile.TryGet(out gamma)) throw new System.NullReferenceException(nameof(gamma));
    }
 
    public void AdjustGamma(float value)
    {
        gamma.gamma.value = new Vector4(value, value, value, 0);
    }
}

Any suggestions? For reference, I’m using HDRP 7.3.1 and Unity 2019.4

I found the solution. The ‘w’ value of the vector4 is what actually controls the gamma, despite what the inspector would lead you to believe:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
 
 
public class UserSettings : MonoBehaviour
{
    private LiftGammaGain gamma;
    private Volume volume;
   
    private void Start()
    {
        volume = GetComponent<Volume>();
        volume.profile.TryGet<LiftGammaGain>(out gamma);
    }
 
    public void AdjustGamma(float value)
    {
        gamma.gamma.value = new Vector4(1f, 1f, 1f, value);
     
    }
}