private Color?GetColor(OutputItem outputItem, Object dropInItem) { var color = outputItem?.Color; if (string.IsNullOrWhiteSpace(color)) { return(null); } return((color != "@") ? RawColor.FromHex(color).ToXnaColor() : DominantColorFinder.GetDominantColor(dropInItem.ParentSheetIndex, Game1.objectSpriteSheet, 16, 16)); }
private Color?ConvertColor(string color) { if (color == null) { return(null); } if (color != "@") { return(RawColor.FromHex(color).ToXnaColor()); } if (heldObject == null) { return(null); } var heldColor = heldObject.GetColor(); if (heldColor != null) { return(heldColor); } return(DominantColorFinder.GetDominantColor(heldObject.ParentSheetIndex, Game1.objectSpriteSheet, 16, 16)); }