diff --git a/prefs.js b/prefs.js index 20961b0..562b30c 100644 --- a/prefs.js +++ b/prefs.js @@ -57,6 +57,7 @@ var PreferencesDialog = class PreferencesDialog { this._bindAdjustment('matrix-randomness'); this._bindColorButton('matrix-trail-color'); this._bindColorButton('matrix-tip-color'); + this._bindColorButton('tv-effect-color'); // The fire-gradient-reset button needs to by bound explicitly. this._builder.get_object('reset-fire-colors').connect('clicked', () => { diff --git a/resources/ui/gtk3.ui b/resources/ui/gtk3.ui index 305f21b..44a8eb1 100644 --- a/resources/ui/gtk3.ui +++ b/resources/ui/gtk3.ui @@ -459,6 +459,82 @@ + + + + 30 + 10 + + + TV Effect Options + 0 + 1 + + + + + + + + + + + none + + + + + 10 + 10 + 10 + 10 + 0 + + + 8 + + + Color + 0 + start + center + 1 + + + + + 1 + 1 + + + + + + + edit-clear-symbolic + 1 + + + Reset to Default Value + + + + + + + + + + + + + diff --git a/resources/ui/gtk4.ui b/resources/ui/gtk4.ui index 7058153..6593c58 100644 --- a/resources/ui/gtk4.ui +++ b/resources/ui/gtk4.ui @@ -578,6 +578,73 @@ + + + 30 + 10 + + + TV Effect Options + 0 + 1 + + + + + + + + + + + none + 1 + + + + + 0 + + + + + Color + 0 + start + center + 1 + + + + + 0 + 1 + + + + + edit-clear-symbolic + Reset to Default Value + + + + + + + + + + + + + + diff --git a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml index d20f685..8b79fa2 100644 --- a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml +++ b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml @@ -96,6 +96,13 @@ The color matrix trails. + + "rgb(255, 255, 255)" + TV Effect Color + The color of the TV effect. + + + \ No newline at end of file diff --git a/src/extension/TVEffectShader.js b/src/extension/TVEffectShader.js index e27f82a..f60db07 100644 --- a/src/extension/TVEffectShader.js +++ b/src/extension/TVEffectShader.js @@ -30,6 +30,9 @@ var TVEffectShader = GObject.registerClass( _init(settings) { super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER}); + const color = + Clutter.Color.from_string(settings.get_string('tv-effect-color'))[1]; + this.set_shader_source(` // Inject some common shader snippets. @@ -68,7 +71,9 @@ var TVEffectShader = GObject.registerClass( float mask = tbMask * lrMask * ffMask; vec4 windowColor = texture2D(uTexture, cogl_tex_coord_in[0].st); - vec4 effectColor = vec4(1, 1, 1, 1) * windowColor.a; + vec4 effectColor = vec4(${color.red / 255}, + ${color.green / 255}, + ${color.blue / 255}, 1.0) * windowColor.a; windowColor.rgb = mix(windowColor.rgb, effectColor.rgb, smoothstep(0, 1, uProgress));