Create a new document any size, create a new layer and draw an object, color the object black.
Control click on your layer to select your object.
Goto “edit > copy” OR “ctrl + c”, then goto “file > new”, LEAVE ALL the settings apart from the background settings, change this to “transparent”.
Now once the new document has been created goto “edit > paste” OR “ctrl + v”.
Press “ctrl + a” to select all and goto “edit > define brush preset” label your new brush.
Now create a new document with your desired background color. Select the paint brush tool then click the menu at the top (see image below).
Select your brush and away you go.