Display custom field value part by part?

Per comments just trim the $colors before use:

if ( get_post_meta( get_the_ID(), 'hex_colors', true ) ){
    $colors = get_post_meta( get_the_ID(), 'hex_colors', true );
    $colors = explode( ' ' , trim( $colors ) );
    foreach( $colors as $color ) {
        echo '<div>', $color, '</div>';
    }
}