In a large bowl, cream together butter and sugar until light and fluffy. Beat in egg and peppermint or almond extract. In a separate bowl, combine flour and salt, gradually add it to the creamed mixture, mix well.
Divide the dough in half and add 10 to 12 drops of red food coloring to one half. Wrap the red and white dough separately and refrigerate for at least 30 minutes before rolling into ropes. Keeping the dough chilled makes it easier to twist ropes.
Take one tablespoon of each color (red & white) dough and roll into 4 inch ropes. Place the ropes side by side; lightly press ends together and twist to form a candy cane. Place on a cookie sheets lined with parchment paper.
Bake at 350 degrees for 9 to 10 minutes. Cool on baking sheet for 2 minutes before removing to wire racks to cool completely. Sprinkle with white and red granulated sugar if desired.