How do I focus light or how do I only draw certain circular parts of the window in pygame?

I suggest a solution, which combines a clipping region pygame.Surface.set_clip and drawing a black rectangle with a circular transparent area in the center. Define a radius and create a square pygame.Surface with twice the radius. radius = 50 cover_surf = pygame.Surface((radius*2, radius*2)) Set a white color key which identifies the transparent color (set_colorkey) a nd … Read more

SVG fill color transparency / alpha?

You use an addtional attribute; fill-opacity: This attribute takes a decimal number between 0.0 and 1.0, inclusive; where 0.0 is completely transparent. For example: <rect … fill=”#044B94″ fill-opacity=”0.4″/> Additionally you have the following: stroke-opacity attribute for the stroke opacity for the entire object

Hatch patterns in gnuplot

Suppose we want to pattern an area between function y=f(x) >0 and y = 0. It is posiible to create different “patterns” by using the following method. (i) Create a file that has 4 columns (x, y, xdelta, ydelta). This file describes a set of lines with the same slope. (ii) Plot data from the … Read more

MATLAB, Filling in the area between two sets of data, lines in one figure

Building off of @gnovice’s answer, you can actually create filled plots with shading only in the area between the two curves. Just use fill in conjunction with fliplr. Example: x=0:0.01:2*pi; %#initialize x array y1=sin(x); %#create first curve y2=sin(x)+.5; %#create second curve X=[x,fliplr(x)]; %#create continuous x value array for plotting Y=[y1,fliplr(y2)]; %#create y values for out … Read more