Fold in the gradient

Change-Id: I64d42e3a485af5933aec1e9441fcc46600db2a4e