public void CalculateUniqueRandom(AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per, VertexColour[] offset_colours)
    {
        int  progression_idx = GetProgressionIndex(progression_variables, animate_per);
        bool constant_offset = offset_colours != null && offset_colours.Length == 1;

        m_values[progression_idx] = m_is_offset_from_last ? offset_colours[constant_offset ? 0 : progression_idx].Clone() : new VertexColour(new Color(0, 0, 0, 0));
        m_values[progression_idx] = m_values[progression_idx].Add(m_from.Add(m_to.Sub(m_from).Multiply(UnityEngine.Random.value)));
    }
    public void CalculateProgressions(int num_progressions, VertexColour[] offset_vert_colours, Color[] offset_colours)
    {
        if (m_progression == ValueProgression.Eased || m_progression == ValueProgression.Random || (m_is_offset_from_last && ((offset_colours != null && offset_colours.Length > 1) || (offset_vert_colours != null && offset_vert_colours.Length > 1))))
        {
            bool constant_offset = (offset_colours != null && offset_colours.Length == 1) || (offset_vert_colours != null && offset_vert_colours.Length == 1);
            m_values = new VertexColour[num_progressions];

            for (int idx = 0; idx < num_progressions; idx++)
            {
                m_values[idx] = m_is_offset_from_last ?
                                (offset_colours != null ? new VertexColour(offset_colours[constant_offset ? 0 : idx]) : offset_vert_colours[constant_offset ? 0 : idx].Clone())

                                                                        : new VertexColour(new Color(0, 0, 0, 0));
            }
        }
        else
        {
            m_values = new VertexColour[1] {
                m_is_offset_from_last ?
                (offset_colours != null ? new VertexColour(offset_colours[0]) : offset_vert_colours[0].Clone())

                                                                        : new VertexColour(new Color(0, 0, 0, 0))
            };
        }


        if (m_progression == ValueProgression.Random)
        {
            for (int idx = 0; idx < num_progressions; idx++)
            {
                m_values[idx] = m_values[idx].Add(m_from.Add(m_to.Sub(m_from).Multiply(UnityEngine.Random.value)));
            }
        }
        else if (m_progression == ValueProgression.Eased)
        {
            float progression;

            for (int idx = 0; idx < num_progressions; idx++)
            {
                progression = num_progressions == 1 ? 0 : (float)idx / ((float)num_progressions - 1f);

                if (m_to_to_bool)
                {
                    if (progression <= 0.5f)
                    {
                        m_values[idx] = m_values[idx].Add(m_from.Add((m_to.Sub(m_from)).Multiply(EasingManager.GetEaseProgress(m_ease_type, progression / 0.5f))));
                    }
                    else
                    {
                        progression  -= 0.5f;
                        m_values[idx] = m_values[idx].Add(m_to.Add((m_to_to.Sub(m_to)).Multiply(EasingManager.GetEaseProgress(m_ease_type, progression / 0.5f))));
                    }
                }
                else
                {
                    m_values[idx] = m_values[idx].Add(m_from.Add((m_to.Sub(m_from)).Multiply(EasingManager.GetEaseProgress(m_ease_type, progression))));
                }
            }
        }
        else if (m_progression == ValueProgression.Constant)
        {
            for (int idx = 0; idx < m_values.Length; idx++)
            {
                m_values[idx] = m_values[idx].Add(m_from);
            }
        }
    }
		public VertexColour GetValue(List<LetterAction> all_letter_actions, int progression_idx, ActionColorProgression defaultAnimColourProg) 
		{
			VertexColour colValue = new VertexColour (Color.clear);
			
			if((m_value_state == PROGRESSION_VALUE_STATE.OFFSET_FROM_REFERENCE || m_value_state == PROGRESSION_VALUE_STATE.REFERENCE))
			{
				ActionColorProgression offsetProgression = m_offset_progression.GetColourProg(all_letter_actions, defaultAnimColourProg);

				if(offsetProgression != null)
				{
					colValue = offsetProgression.GetValue(all_letter_actions, progression_idx, defaultAnimColourProg);
					
					if(m_value_state == PROGRESSION_VALUE_STATE.OFFSET_FROM_REFERENCE && m_override_alpha)
						colValue.ClearAlpha();
				}
			}
			
			if(m_value_state == PROGRESSION_VALUE_STATE.OFFSET_FROM_REFERENCE || m_value_state == PROGRESSION_VALUE_STATE.UNIQUE)
			{
				int num_vals = m_values.Length;
				if(num_vals > 1 && progression_idx < num_vals)
				{
					colValue = colValue.Add( m_values[progression_idx] );
				}
				else if(num_vals==1)
				{
					colValue = colValue.Add( m_values[0] );
				}
				else
				{
					colValue = colValue.Add(new VertexColour(Color.clear) );
				}
			}

			return colValue;
		}