improve sanity checks on gradient constructor parameters

BUG=445807

Review URL: https://codereview.chromium.org/837013002
1 file changed