Table of Contents

Method Parse

Namespace
MigraDoc.DocumentObjectModel
Assembly
MigraDoc.DocumentObjectModel.dll

Parse(string)

Parses the string and returns a color object. Throws ArgumentException if color is invalid. Supports four different formats for hex colors. Format 1: uses prefix "0x", followed by as many hex digits as needed. Important: do not forget the opacity, so use 7 or 8 digits. Format 2: uses prefix "#", followed by exactly 8 digits including opacity. Format 3: uses prefix "#", followed by exactly 6 digits; opacity will be 0xff. Format 4: uses prefix "#", followed by exactly 3 digits; opacity will be 0xff; "#ccc" will be treated as "#ffcccccc", "#d24" will be treated as "#ffdd2244".

public static Color Parse(string color)

Parameters

color string

integer, hex or color name.

Returns

Color