A scalar field assigns a real value to each point in space or on a plane. It's a scalar valued function of 2 or 3 variables This value, which could represent temperature, pressure, altitude, or any other scalar quantity, can be visualized in two dimensions using a color gradient. For instance, temperature distribution across a map, pressure distribution in a fluid, or altitude variations over a landscape are all examples of scalar fields that can be depicted using color gradients.
The gradient associates a vector field with a scalar field. The gradient vector points in the direction of the maximum rate of increase