private void load(OsuColour colours) { defaultBackgroundColour = colours.Gray3; defaultBubbleColour = defaultBackgroundColour.Darken(0.5f); selectedBackgroundColour = colours.BlueDark; selectedBubbleColour = selectedBackgroundColour.Lighten(0.5f); Triangles.Alpha = 0; Content.EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Radius = 2, Offset = new Vector2(0, 1), Colour = Color4.Black.Opacity(0.5f) }; Add(icon = (button.CreateIcon?.Invoke() ?? new Circle()).With(b => { b.Blending = BlendingParameters.Additive; b.Anchor = Anchor.CentreLeft; b.Origin = Anchor.CentreLeft; b.Size = new Vector2(20); b.X = 10; })); }
protected override void Update() { base.Update(); // the point at which alpha is saturated and we begin to adjust colour lightness. const float lighten_cutoff = 0.95f; // the amount of lightness to attribute regardless of relative value to peak point. const float non_relative_portion = 0.2f; float amount = 0; // give some amount of alpha regardless of relative count amount += non_relative_portion * Math.Min(1, count / 10f); // add relative portion amount += (1 - non_relative_portion) * (count / heatmap.PeakValue); // apply easing amount = (float)Interpolation.ApplyEasing(Easing.OutQuint, Math.Min(1, amount)); Debug.Assert(amount <= 1); Alpha = Math.Min(amount / lighten_cutoff, 1); if (pointType == HitPointType.Hit) { Colour = BaseColour.Lighten(Math.Max(0, amount - lighten_cutoff)); } }
public void UpdateColour(Color4 colour) { backgroundBox.Colour = colour.Darken(0.5f); triangles.Colour = colour; triangles.Alpha = 0.8f; spriteIcon.Colour = colour.Lighten(0.5f); }
private void updateColours(Color4 colour) { background.Colour = colour.Darken(0.5f); triangles.Colour = colour; triangles.Alpha = 0.8f; orbSpriteIcon.Colour = colour.Lighten(0.5f); }
/// <summary> /// Updates the state of the circular control point marker. /// </summary> private void updateMarkerDisplay() { Position = slider.StackedPosition + ControlPoint.Position.Value; markerRing.Alpha = IsSelected.Value ? 1 : 0; Color4 colour = ControlPoint.Type.Value != null ? colours.Red : colours.Yellow; if (IsHovered || IsSelected.Value) { colour = colour.Lighten(1); } marker.Colour = colour; }
private void load(OsuColour colours) { Origin = Anchor.TopLeft; Anchor = Anchor.TopLeft; AutoSizeAxes = Axes.X; RelativeSizeAxes = Axes.Y; Color4 colour = samplePoint.GetRepresentingColour(colours); InternalChildren = new Drawable[] { new Container { RelativeSizeAxes = Axes.Y, Width = 20, Children = new Drawable[] { volumeBox = new Box { X = 2, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Colour = ColourInfo.GradientVertical(colour, Color4.Black), RelativeSizeAxes = Axes.Both, }, new Box { Colour = colour.Lighten(0.2f), Width = 2, RelativeSizeAxes = Axes.Y, }, } }, text = new OsuSpriteText { X = 2, Y = -5, Anchor = Anchor.BottomLeft, Alpha = 0.9f, Rotation = -90, Font = OsuFont.Default.With(weight: FontWeight.SemiBold) } }; volume.BindValueChanged(volume => volumeBox.Height = volume.NewValue / 100f, true); bank.BindValueChanged(bank => text.Text = bank.NewValue, true); }
/// <summary> /// Updates the state of the circular control point marker. /// </summary> private void updateMarkerDisplay() { Position = slider.StackedPosition + ControlPoint.Position.Value; markerRing.Alpha = IsSelected.Value ? 1 : 0; Color4 colour = getColourFromNodeType(); if (IsHovered || IsSelected.Value) { colour = colour.Lighten(1); } marker.Colour = colour; marker.Scale = new Vector2(slider.Scale); }
private void load(OsuColour colours) { defaultBackgroundColour = colours.Gray3; defaultBubbleColour = defaultBackgroundColour.Darken(0.5f); selectedBackgroundColour = colours.BlueDark; selectedBubbleColour = selectedBackgroundColour.Lighten(0.5f); Triangles.Alpha = 0; Content.EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Radius = 2, Offset = new Vector2(0, 1), Colour = Color4.Black.Opacity(0.5f) }; Add(bubble); }
protected override bool OnHover(HoverEvent e) { background.FadeColour(backgroundColour.Lighten(0.1f), 300, Easing.OutQuint); return(base.OnHover(e)); }