The ulnar nerve originates from the medial cord of the brachial plexus
The medial cord is derived from the anterior division of the inferior trunk, which is derived from the ventral rami of the spinal nerve roots of C8 and T1

The green colour of the ulnar nerve can be tracked backwards to the spinal nerve roots
