You can accomplish this using data-defined properties (as pointed out in comment by underdark). You need to generate a string in the format
'<red>, <green>, <blue>, <alpha>, where each slot is a number from 0 to 255. A "pure" red would be represented as
'255, 0, 0, 255'. In practice, alpha can be omitted unless you want some degree of transparency, and I will omit it in the rest of my examples.
In order to access data-defined properties, go to the Style tab of the Layer Properties dialog and choose Single Symbol (the default for a new layer). On the left you will see a list of Symbol layers. Click on Simple fill. When you do, you will see the Symbol layer properties on the right. Click on the Data defined properties button:
In the Data defined properties dialog, check Color and click the button labelled
... in the Expressions column:
Now you're in the Expression string builder and need to construct your string representing the RGB color. Convention dictates that we should use a high-value, low-saturation color (white, pale gray, other light and/or dull colors) to represent low data values and low-value (i.e. dark), high-saturation colors to indicate high data values. In the simplest case of a white-black color ramp, we want low data values to map to
'255, 255, 255' and high data values to map to
'0, 0, 0'. An expression which would accomplish this is:
tostring(255 - 255 * "<field_name>" / <max_field_value>) || ', '
|| tostring(255 - 255 * "<field_name>" / <max_field_value>) || ', '
|| tostring(255 - 255 * "<field_name>" / <max_field_value>)
As far as I know you can't use aggregate functions in expression builders, so you will have to manually insert the maximum value for the field in place of
<max_field_value>. (Alternatively, add a column with the maximum value repeated for all records, or use a window function in PostGIS.)
If your lowest value isn't 0, it may be easier to use the scale_linear function:
tostring(toint(scale_linear("<field_name>", 0, <max_field_value>, 255, 0))) || ', '
|| tostring(toint(scale_linear("<field_name>", 0, <max_field_value>, 255, 0))) || ', '
|| tostring(toint(scale_linear("<field_name>", 0, <max_field_value>, 255, 0)))
Another advantage is that by reversing the output range, you can get low data values at 255 and high data values at 0 without having to use the
255 - <expression> trick that I used in the previous iteration.
To get colors, it will be easiest to work with the pure colors of red, green, blue, cyan, magenta, and yellow. In this case, leave one or two values pinned at 255 and allow the other one or two to vary linearly with the data. For example, to get an unclassed choropleth ramped from white to magenta, keep red and blue pinned at 255:
'255 , ' || tostring(toint(scale_linear(dp0010001, 0, 9818605, 255, 0))) || ', 255'
To get more complex ramps, you're going to have to fool around with the math to get the colors where you want.
As an aside, as underdark points out, you can accomplish much the same result by using Graduated Colors with a large number of categories and using the Equal Interval setting. Anything above 50 categories will probably be indistinguishable from an unclassed choropleth. If you want, QGIS allows you to go up to 999 categories.