mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
Properly ignore alpha of lookup map
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.dfsek.terra.addons.image.util.ColorUtil;
|
||||
import com.dfsek.terra.addons.image.util.MapUtil;
|
||||
|
||||
|
||||
public class ExactColorConverter<T> implements ColorConverter<T> {
|
||||
@@ -15,6 +16,9 @@ public class ExactColorConverter<T> implements ColorConverter<T> {
|
||||
private final boolean ignoreAlpha;
|
||||
|
||||
public ExactColorConverter(Map<Integer, T> map, T fallback, boolean ignoreAlpha) {
|
||||
if (ignoreAlpha) {
|
||||
map = MapUtil.mapKeys(map, ColorUtil::zeroAlpha);
|
||||
}
|
||||
this.map = map;
|
||||
this.fallback = fallback;
|
||||
this.ignoreAlpha = ignoreAlpha;
|
||||
|
||||
Reference in New Issue
Block a user