Skip to content

Commit 6653df5

Browse files
committed
Add brightness slider to Hue/Saturation editor
1 parent 108e4dc commit 6653df5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

js/texturing/edit_image.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ BARS.defineActions(function() {
154154
preview_changes: true,
155155
saturation: 100,
156156
hue: 0,
157+
brightness: 100,
157158
textures
158159
}},
159160
methods: {
@@ -164,7 +165,7 @@ BARS.defineActions(function() {
164165
texture.selection.maskCanvas(ctx, env.offset);
165166
ctx.clearRect(0, 0, texture.width, texture.height);
166167
if (this.preview_changes) {
167-
ctx.filter = `saturate(${this.saturation / 100}) hue-rotate(${this.hue}deg)`;
168+
ctx.filter = `saturate(${this.saturation / 100}) hue-rotate(${this.hue}deg) brightness(${this.brightness / 100})`;
168169
} else {
169170
ctx.filter = `brightness(1.0)`;
170171
}
@@ -200,6 +201,11 @@ BARS.defineActions(function() {
200201
<input type="range" class="tool" min="-180" max="180" step="1" v-model.number="hue" @input="change()">
201202
<numeric-input class="tool" :min="-180" :max="180" :step="1" v-model.number="hue" @input="change()" />
202203
</div>
204+
<label class="form_label_compact">${tl('dialog.adjust_brightness_contrast.brightness')}</label>
205+
<div class="bar slider_input_combo">
206+
<input type="range" class="tool" min="0" max="200" step="1" v-model.number="brightness" @input="change()">
207+
<numeric-input class="tool" :min="0" :max="200" :step="1" v-model.number="brightness" @input="change()" />
208+
</div>
203209
<div class="bar button_bar_checkbox">
204210
<input type="checkbox" v-model="preview_changes" id="checkbox_preview_changes" @change="change()">
205211
<label for="checkbox_preview_changes">${tl('dialog.edit_texture.preview')}</label>

0 commit comments

Comments
 (0)