CesiumLanguageWriter.Advanced.CesiumWritingHelper.WriteRgba C# (CSharp) Method

WriteRgba() public static method

Writes time-tagged color values as an array in [Time, Red, Green, Blue, Alpha] order. Times are epoch seconds since an epoch that is determined from the first date to be written. The epoch property is written as well.
public static WriteRgba ( CesiumOutputStream output, string propertyName, IList dates, IList values, int startIndex, int length ) : void
output CesiumOutputStream The stream to which to write the array.
propertyName string The name of the property to write.
dates IList The dates at which the value is specified.
values IList The corresponding value for each date.
startIndex int The index of the first element to use in the collection.
length int The number of elements to use from the collection.
return void
        public static void WriteRgba(CesiumOutputStream output, string propertyName, IList<JulianDate> dates, IList<Color> values, int startIndex, int length)
        {
            if (dates.Count != values.Count)
                throw new ArgumentException(CesiumLocalization.MismatchedNumberOfDatesAndValues, "values");

            JulianDate epoch = GetAndWriteEpoch(output, dates, startIndex, length);

            output.WritePropertyName(propertyName);
            output.WriteStartSequence();
            int last = startIndex + length;
            for (int i = startIndex; i < last; ++i)
            {
                output.WriteValue(epoch.SecondsDifference(dates[i]));
                Color value = values[i];
                output.WriteValue(value.R);
                output.WriteValue(value.G);
                output.WriteValue(value.B);
                output.WriteValue(value.A);
                output.WriteLineBreak();
            }

            output.WriteEndSequence();
        }

Same methods

CesiumWritingHelper::WriteRgba ( CesiumOutputStream output, Color value ) : void
CesiumWritingHelper::WriteRgba ( CesiumOutputStream output, int red, int green, int blue, int alpha ) : void