Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

hex to rgb function

function hex2RGB(hex){
        const r = parseInt(hex.substring(1, 3), 16);
        const g = parseInt(hex.substring(3, 5), 16);
        const b = parseInt(hex.substring(5, 7), 16);
        return `${r}, ${g}, ${b}`;
}
 
PREVIOUS NEXT
Tagged: #hex #rgb #function
ADD COMMENT
Topic
Name
4+3 =