In Spain, mourning is often showed by the addition of a black ribbon to the national flag. The photograph below shows a mourning flag displayed following the Madrid bombing.
A small piece of black material is stitched to the flag. There does not appear to be a convention for shape or size. It could be a black handkerchief, or as above a black ribbon. The addition of the black symbol appears to be mainly for flags that are displayed indoors.
Military colours, when used to signify mourning, tend to use a black ribbon attached to the finial.