/// <summary> /// Reads RGBA gradient from the reader. /// </summary> /// <param name="reader">The reader from which to read gradient.</param> /// <returns></returns> public static GradientRGBA ReadGradientRGBA(this ISwfStreamReader reader) { var gradient = new GradientRGBA { SpreadMode = (SpreadMode)reader.ReadUnsignedBits(2), InterpolationMode = (InterpolationMode)reader.ReadUnsignedBits(2) }; var count = reader.ReadUnsignedBits(4); for (var i = 0; i < count; i++) { GradientRecordRGBA record = reader.ReadGradientRecordRGBA(); gradient.GradientRecords.Add(record); } return(gradient); }