Skip to content

Commit

Permalink
fix ArgumentOutOfRangeException with sepia colors
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Dec 24, 2024
1 parent fcbe3a1 commit 5257dec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/render/SepiaRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
public class SepiaRenderer : Renderer {
public static bool IsWater(int? id) => id == null || LiveMap.Api.SepiaColors.BlockIsWater[(int)id];
public static byte GetIndex(int id) => LiveMap.Api.SepiaColors.Block2Color[id];
public static uint GetColor(int index) => LiveMap.Api.SepiaColors.ColorsByCode.GetValueAtIndex(index);
public static uint GetColor(string id) => LiveMap.Api.SepiaColors.ColorsByCode[id];
public static uint GetColor(int index) {
return index >= 0 && index < LiveMap.Api.SepiaColors.ColorsByCode.Count
? LiveMap.Api.SepiaColors.ColorsByCode.GetValueAtIndex(index)
: GetColor("ocean");
}

public SepiaRenderer() : base("sepia") { }

Expand Down

0 comments on commit 5257dec

Please # to comment.