Add grayscaledark attribute to control dark color in graytone

This commit is contained in:
Mike Primm 2020-05-16 17:06:14 -05:00
parent ee8c919eda
commit 23ea19e737
2 changed files with 12 additions and 2 deletions

View File

@ -12,20 +12,22 @@ public class DefaultHDLighting implements HDLighting {
private String name;
protected boolean grayscale;
protected final Color graytone;
protected final Color graytonedark;
public DefaultHDLighting(DynmapCore core, ConfigurationNode configuration) {
name = (String) configuration.get("name");
grayscale = configuration.getBoolean("grayscale", false);
graytone = configuration.getColor("graytone", null);
graytonedark = configuration.getColor("graytonedark", "#000000");
}
protected void checkGrayscale(Color[] outcolor) {
if (grayscale) {
outcolor[0].setGrayscale();
if (graytone != null) outcolor[0].blendColor(graytone);
if (graytone != null) outcolor[0].scaleColor(graytonedark,graytone);
if (outcolor.length > 1) {
outcolor[1].setGrayscale();
if (graytone != null) outcolor[1].blendColor(graytone);
if (graytone != null) outcolor[1].scaleColor(graytonedark, graytone);
}
}
}

View File

@ -122,4 +122,12 @@ lightings:
color6: '#FFCC99'
color7: '#FFFF00'
night-and-day: true
# Shadows enabled day mode - grayscale parchment, brown ink
- class: org.dynmap.hdmap.ShadowHDLighting
name: parchmentbrownink
shadowstrength: 1.0
grayscale: true
graytone: '#C09A53'
graytonedark: '#400000'
smooth-lighting: true