Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 5640bee

Browse files
authored
Merge pull request #236 from UnityTech/fix_color_filter
Fix color filter.
2 parents 83a90d6 + 732c911 commit 5640bee

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Runtime/painting/decoration_image.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ public static void paintImage(
252252
Paint paint = new Paint();
253253
if (colorFilter != null) {
254254
paint.colorFilter = colorFilter;
255+
paint.color = colorFilter.color;
256+
paint.blendMode = colorFilter.blendMode;
255257
}
256258

257259
if (sourceSize != destinationSize) {

Runtime/rendering/image.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public RenderImage(
3333
this._alignment = alignment ?? Alignment.center;
3434
this._invertColors = invertColors;
3535
this._filterMode = filterMode;
36+
this._updateColorFilter();
3637
}
3738

3839
Image _image;
@@ -115,6 +116,7 @@ public Color color {
115116
}
116117

117118
this._color = value;
119+
this._updateColorFilter();
118120
this.markNeedsPaint();
119121
}
120122
}
@@ -129,6 +131,7 @@ public BlendMode colorBlendMode {
129131
}
130132

131133
this._colorBlendMode = value;
134+
this._updateColorFilter();
132135
this.markNeedsPaint();
133136
}
134137
}

0 commit comments

Comments
 (0)