But, how can I change the color of this line ?
Each vertex has a position and a color property.
sf::Vertex line[2];
line[0].position = sf::Vector2f(10, 0);
line[0].color = sf::Color::Red;
line[1].position = sf::Vector2f(20, 0);
line[1].color = sf::Color::Red;
If the two vertices of the line have a different color, you'll obtain a gradient from color 1 to color 2.