withAlpha

fun withAlpha(alpha: Float): PdfColor

Returns a copy of this color with the given alpha (0f opaque-less, 1f fully opaque). Convenient for fading existing palette colors:

val ghostBlue = PdfColor.Blue.withAlpha(0.2f)