fix tint
This commit is contained in:
parent
314099c9a6
commit
35749adf70
|
@ -30,6 +30,8 @@ public class Main {
|
||||||
pict = stackViewer.push(UtilMatrix.blurGauss(pict, 3, 2));
|
pict = stackViewer.push(UtilMatrix.blurGauss(pict, 3, 2));
|
||||||
pict = stackViewer.push(UtilMatrix.sharpen(pict, 3));
|
pict = stackViewer.push(UtilMatrix.sharpen(pict, 3));
|
||||||
pict = stackViewer.push(UtilColor.tint(pict, new Color(255, 0, 0, 128)));
|
pict = stackViewer.push(UtilColor.tint(pict, new Color(255, 0, 0, 128)));
|
||||||
|
pict = stackViewer.push(UtilColor.tint(pict, new Color(0, 255, 0, 0)));
|
||||||
|
pict = stackViewer.push(UtilColor.tint(pict, new Color(0, 0, 255, 255)));
|
||||||
pict.save(run.resolve("moscov.png"));
|
pict.save(run.resolve("moscov.png"));
|
||||||
stackViewer.repaint();
|
stackViewer.repaint();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class MColor {
|
||||||
|
|
||||||
//Alpha of tint is strength: 255 = equal to base, 0 = no effect
|
//Alpha of tint is strength: 255 = equal to base, 0 = no effect
|
||||||
public MColor tint(Color t) {
|
public MColor tint(Color t) {
|
||||||
double f = t.getAlpha() / 255d;
|
double f = t.getAlpha() / 512d;
|
||||||
this.mult(1 - f);
|
this.mult(1 - f);
|
||||||
r += t.getRed() * f;
|
r += t.getRed() * f;
|
||||||
g += t.getGreen() * f;
|
g += t.getGreen() * f;
|
||||||
|
|
Reference in New Issue