DEV Community

Discussion on: Daily Challenge #158 - RGB To Hex Conversion

Collapse
nickholmesde profile image
Nick Holmes

In C#, you don't even really need to implement a method for this, as its easily done with string interpolation;

    var rgb  = $"{red:X02}{green:X02}{blue:X02}";

(Useful for unique ad-hoc strings, but usually better factored out to a method anyway)