Currently, I am facing a challenge in my task involving colors while working with three.js, a JavaScript library. In this particular task, I need to convert decimal color codes (e.g. 12615680
) into formats like #FF0000
or 0xFF0000
. I am seeking a JavaScript solution in the form of a function that can perform this conversion from decimal to hex color codes.