diff options
| author | tassaron | 2017-05-22 19:42:32 -0400 |
|---|---|---|
| committer | tassaron | 2017-05-22 19:42:32 -0400 |
| commit | 07644f03486e4812ac85839b5eaba9f8bbbf890a (patch) | |
| tree | 92b61268957a9186fc187398d4f00cc2089d9087 /core.py | |
| parent | 77eed58a87a4b2c79ee2fd8abffec4471ff56095 (diff) | |
text and visualization colour can be changed using commandline
Diffstat (limited to 'core.py')
| -rw-r--r-- | core.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -42,7 +42,8 @@ class Core(): else: return self.getVideoFrames(backgroundImage, preview) - def drawBaseImage(self, backgroundFile, titleText, titleFont, fontSize, alignment, xOffset, yOffset): + def drawBaseImage(self, backgroundFile, titleText, titleFont, fontSize, alignment,\ + xOffset, yOffset, textColor, visColor): if backgroundFile == '': im = Image.new("RGB", (1280, 720), "black") else: @@ -62,7 +63,7 @@ class Core(): font = titleFont font.setPointSizeF(fontSize) painter.setFont(font) - painter.setPen(QColor(255, 255, 255)) + painter.setPen(QColor(*textColor)) yPosition = yOffset @@ -86,13 +87,15 @@ class Core(): strio.seek(0) return Image.open(strio) - def drawBars(self, spectrum, image): + def drawBars(self, spectrum, image, color): imTop = Image.new("RGBA", (1280, 360)) draw = ImageDraw.Draw(imTop) + r, g, b = color + color2 = (r, g, b, 50) for j in range(0, 63): - draw.rectangle((10 + j * 20, 325, 10 + j * 20 + 20, 325 - spectrum[j * 4] * 1 - 10), fill=(255, 255, 255, 50)) - draw.rectangle((15 + j * 20, 320, 15 + j * 20 + 10, 320 - spectrum[j * 4] * 1), fill="white") + draw.rectangle((10 + j * 20, 325, 10 + j * 20 + 20, 325 - spectrum[j * 4] * 1 - 10), fill=color2) + draw.rectangle((15 + j * 20, 320, 15 + j * 20 + 10, 320 - spectrum[j * 4] * 1), fill=color) imBottom = imTop.transpose(Image.FLIP_TOP_BOTTOM) |
