@@ -476,8 +476,8 @@ internal void ToString(System.Text.StringBuilder builder)
476476 /// <item><c>"x"</c> — XAML hex without alpha: <c>#RRGGBB</c></item>
477477 /// <item><c>"H"</c> — HTML hex with alpha: <c>#RRGGBBAA</c></item>
478478 /// <item><c>"h"</c> — HTML hex without alpha: <c>#RRGGBB</c></item>
479- /// <item><c>"R"</c> — CSS rgb with alpha: <c>rgb(r, g, b, a)</c></item>
480- /// <item><c>"r"</c> — CSS rgb without alpha: <c>rgb(r, g, b)</c></item>
479+ /// <item><c>"R"</c> or <c>"C"</c> — CSS rgb with alpha: <c>rgb(r, g, b, a)</c></item>
480+ /// <item><c>"r"</c> or <c>"c"</c> — CSS rgb without alpha: <c>rgb(r, g, b)</c></item>
481481 /// <item><c>"P"</c> — CSS rgb percent with alpha: <c>rgb(r%, g%, b%, a%)</c></item>
482482 /// <item><c>"p"</c> — CSS rgb percent without alpha: <c>rgb(r%, g%, b%)</c></item>
483483 /// </list>
@@ -498,8 +498,8 @@ public string ToString(string? format, IFormatProvider? formatProvider)
498498 "x" => $ "#{ R : X2} { G : X2} { B : X2} ",
499499 "H" => $ "#{ R : X2} { G : X2} { B : X2} { A : X2} ",
500500 "h" => $ "#{ R : X2} { G : X2} { B : X2} ",
501- "R" => string . Format ( CultureInfo . InvariantCulture , "rgb({0}, {1}, {2}, {3:F2})" , R , G , B , A * byteToDouble ) ,
502- "r" => string . Format ( CultureInfo . InvariantCulture , "rgb({0}, {1}, {2})" , R , G , B ) ,
501+ "R" or "C" => string . Format ( CultureInfo . InvariantCulture , "rgb({0}, {1}, {2}, {3:F2})" , R , G , B , A * byteToDouble ) ,
502+ "r" or "c" => string . Format ( CultureInfo . InvariantCulture , "rgb({0}, {1}, {2})" , R , G , B ) ,
503503 "P" => FormatCssRgbPercentWithAlpha ( ) ,
504504 "p" => FormatCssRgbPercentWithoutAlpha ( ) ,
505505 _ => throw new FormatException ( $ "Format string '{ format } ' is not supported.")
0 commit comments