from_known_color method

from_known_color(known_color)

Creates a color from the specified predefined color.
This is the only way to obtain a system color (such as KnownColor.CONTROL): system colors are not exposed as Color attributes because their values depend on the desktop theme, so they are read from the library runtime.

Returns

The color that this method creates.

@staticmethod
def from_known_color(known_color):
    ...
ParameterTypeDescription
known_colorKnownColorAn element of the KnownColor enumeration (an IntEnum mirroring .NET System.Drawing.KnownColor) or its integer value.

Exceptions

ExceptionDescription
ValueErrorThe value is not a valid KnownColor member.

See Also