Try fix RGBee (#28741)

This commit is contained in:
Leon Friedrich
2024-06-08 22:27:21 +12:00
committed by GitHub
parent 74ed68b2d5
commit 7ef7fe6761

View File

@@ -207,8 +207,11 @@ namespace Content.Client.Light
public static Color GetCurrentRgbColor(TimeSpan curTime, TimeSpan offset, Entity<RgbLightControllerComponent> rgb) public static Color GetCurrentRgbColor(TimeSpan curTime, TimeSpan offset, Entity<RgbLightControllerComponent> rgb)
{ {
var delta = (float)(curTime - offset).TotalSeconds;
var entOffset = Math.Abs(rgb.Owner.Id * 0.09817f);
var hue = (delta * rgb.Comp.CycleRate + entOffset) % 1;
return Color.FromHsv(new Vector4( return Color.FromHsv(new Vector4(
(float) (((curTime.TotalSeconds - offset.TotalSeconds) * rgb.Comp.CycleRate + Math.Abs(rgb.Owner.Id * 0.1)) % 1), MathF.Abs(hue),
1.0f, 1.0f,
1.0f, 1.0f,
1.0f 1.0f