Пример #1
0
        private void load()
        {
            // todo: this should come from the skin.
            AccentColour = colourForRrepesentation(HitObject.VisualRepresentation);

            InternalChildren = new[]
            {
                createPulp(HitObject.VisualRepresentation),
                border = new Circle
                {
                    EdgeEffect = new EdgeEffectParameters
                    {
                        Hollow = !HitObject.HyperDash,
                        Type   = EdgeEffectType.Glow,
                        Radius = 4,
                        Colour = HitObject.HyperDash ? Color4.Red : AccentColour.Darken(1).Opacity(0.6f)
                    },
                    Size            = new Vector2(Height * 1.5f),
                    Anchor          = Anchor.Centre,
                    Origin          = Anchor.Centre,
                    BorderColour    = Color4.White,
                    BorderThickness = 4f,
                    Children        = new Framework.Graphics.Drawable[]
                    {
                        new Box
                        {
                            AlwaysPresent    = true,
                            Colour           = AccentColour,
                            Alpha            = 0,
                            RelativeSizeAxes = Axes.Both
                        }
                    }
                },
            };

            if (HitObject.HyperDash)
            {
                AddInternal(new Pulp
                {
                    RelativePositionAxes = Axes.Both,
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    AccentColour = Color4.Red,
                    Blending     = BlendingMode.Additive,
                    Alpha        = 0.5f,
                    Scale        = new Vector2(1.333f)
                });
            }
        }
Пример #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));
            }