How the browser turns "90deg" into a line, worked through by hand
Take the gradient linear-gradient(90deg, #ff7a45 0%, #3d5afe 100%) on a box 200 pixels wide and 100 pixels tall. The angle says which way the gradient runs. In CSS, 0deg points straight up and angles turn clockwise, so 90deg points to the right. The gradient line goes through the centre of the box, at (100, 50), in that direction, and the first colour sits at its start, the second at its end.
The interesting part is how long that line is. CSS makes it exactly long enough that the corners of the box get the pure end colours. The formula is the width times the sine of the angle plus the height times the cosine, both taken as positive numbers. At 90deg the sine is 1 and the cosine is 0, so the line is 200 × 1 + 100 × 0 = 200 pixels long: it runs from the left edge at (0, 50) to the right edge at (200, 50). Halfway along, at x = 100, the colour is an even mix of orange and blue.
Now turn the same box to 45deg. The sine and cosine are both about 0.7071, so the line is 200 × 0.7071 + 100 × 0.7071, or about 212 pixels, longer than either side. That stretch is what makes the bottom-left corner pure orange and the top-right corner pure blue. Canvas drawing in JavaScript does not do this for you; it draws a gradient between two points you name. The Background Generator on this site uses this exact sum to paint a PNG that matches the CSS, and its test suite checks a 45deg line in a 100 by 100 square comes out at 141.42 pixels.
Radial gradients have a similar hidden default. Unless you say otherwise, the shape is an ellipse sized to reach the farthest corner of the box. From the centre of a 200 by 100 box, the farthest side is 100 pixels away across and 50 pixels down, and the ellipse is those two figures multiplied by the square root of 2, about 141 by 71 pixels, so its edge passes exactly through the corners. A circle uses the straight-line distance to the farthest corner instead, which for the same box is about 112 pixels.
A few honest limits. The colours blend in the sRGB colour space by default, which is why blue to yellow goes through a greyish middle; modern CSS lets you write "in oklch" to blend differently, and this tool does not add that for you. A mesh made of radial layers is an approximation of the meshes drawn in design apps, which bend colour along curves; it gives the soft, cloudy look, not exact control of every point. And very large gradients with few colours can show faint banding on some screens, which a little noise over the top hides; the Pattern Generator makes that noise.