Hi..
Welcome to HEALTHCARE MAGIC..
I have gone through your query and can understand your concerns..
As per your complain it seems that due to bumping the thigh with the desk there has been traumatic injury to the soft tissues leading to swelling and the red area seems to be due to broken blood vessels leading to spillage of blood in the soft tissues and 
hematoma formation..
You need not to worry as gradually as the healing will proceed and inflammation will subside pain will reduce..
Blood will also gradually disintegrate from the soft tissues leading to fading of 
redness..
I would suggest you to take anti-inflammatory painkiller like 
Ibuprofen..
Do cool compresses over the swelling..
You can apply an 
analgesic ointment over it..
You can also  apply 
Heparin ointment as it will help in fading of the bruising and faster disintegration of the blood clot..
Elevate your leg while lying down..
In case if the condition worsen or there is no improvement in a week consult a General Physician and get evaluated..
Hope this information helps..
Thanks and regards.
Dr.Honey Nandwani Arora.