Exemple #1
0
        private static Color4 getFillColour(double hp)
        {
            if (hp < 0.2)
            {
                return(LegacyUtils.InterpolateNonLinear(0.2 - hp, Color4.Black, Color4.Red, 0, 0.2));
            }

            if (hp < epic_cutoff)
            {
                return(LegacyUtils.InterpolateNonLinear(0.5 - hp, Color4.White, Color4.Black, 0, 0.5));
            }

            return(Color4.White);
        }
Exemple #2
0
            protected override Colour4 ColourAt(float position)
            {
                float realBorderPortion   = shadow_portion + CalculatedBorderPortion;
                float realGradientPortion = 1 - realBorderPortion;

                if (position <= shadow_portion)
                {
                    return(new Colour4(0f, 0f, 0f, 0.25f * position / shadow_portion));
                }

                if (position <= realBorderPortion)
                {
                    return(BorderColour);
                }

                position -= realBorderPortion;

                Colour4 outerColour = AccentColour.Darken(0.1f);
                Colour4 innerColour = lighten(AccentColour, 0.5f);

                return(LegacyUtils.InterpolateNonLinear(position / realGradientPortion, outerColour, innerColour, 0, 1));
            }