Browse Source

added waveforms to theme invert

Jonathan Higgins 3 months ago
parent
commit
7c42f2a1f5
1 changed files with 13 additions and 1 deletions
  1. 13 1
      addons/audio_preview/voice_preview_generator.gd

+ 13 - 1
addons/audio_preview/voice_preview_generator.gd

@@ -9,7 +9,10 @@ const IMAGE_HEIGHT: int = 64
 
 var image_compression: float = 10.0 # How many samples in one pixel
 var background_color = Color(0, 0, 0, 0)
-var foreground_color = Color.SILVER
+var foreground_color
+
+
+
 
 
 
@@ -26,6 +29,15 @@ var must_abort := false
 
 
 func generate_preview(stream: AudioStreamWAV, image_max_width: int = 500):
+	#set colour based on theme
+	var interface_settings = ConfigHandler.load_interface_settings()
+	#check if the theme is inverted
+	if interface_settings.invert_theme:
+		foreground_color = Color(0.102, 0.102, 0.102, 0.6)
+	else:
+		foreground_color = Color(0.898, 0.898, 0.898, 0.6)
+	
+	
 	if not stream:
 		return
 	if stream.format == AudioStreamWAV.FORMAT_IMA_ADPCM: