A three-digit hex code is expanded by doubling each digit. The conversion between RGB and HSL uses the usual geometric formula and rounds the channels to whole numbers.
There is no named-color list and no alpha channel. #ff0000 is pure red: rgb(255, 0, 0) and hsl(0, 100%, 50%). Rounding can move a converted HSL value by one unit when it comes back.