[reportlab-users] Slightly confused with setFillGray

Frank frank at chagford.com
Thu Jan 16 00:00:16 EST 2020


On 2020-01-15 10:06 PM, Tim Roberts wrote:
> Frank wrote:
>>
>> This is a minor point, but I want to make sure I understand it.
>>
>> I thought that setFillGray(0), setFillColorRGB(0, 0 ,0), and 
>> setFillColor(colors.black) were interchangeable.
>>
[...]
> 
> Nope, that's the way it works.  setFillGray, setFillColorRGB, 
> setStrokeGray, and SetStrokeColorRGB all have an additional parameter to 
> specify the alpha value.  If you don't supply a value, the current alpha 
> value is retained.  "colors.black" happens to include all four components.
> 

I should have noticed that extra parameter - sorry about that.

Many thanks.

Frank



More information about the reportlab-users mailing list