YouTube uses red for the play button in its logo, with a white triangle in the center. The brand name appears in a near-pure black, or in white on dark backgrounds. The HEX codes come from the brand guidelines published by the company.
Values taken from the brand guidelines or another official specification. Brand names and colors belong to their owners; this page only lists color codes for information.