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