aboutsummaryrefslogtreecommitdiff
path: root/src/components/color.py
diff options
context:
space:
mode:
authortassaron2017-06-24 23:12:41 -0400
committertassaron2017-06-24 23:12:41 -0400
commite32ba958cb95146728d4985221b08c7e01b35470 (patch)
tree1fce99082617a5a92a758851e51c32999774d212 /src/components/color.py
parent4d955c5a06d8d77c968f594a85b71b516919bcfb (diff)
fixing bugs
Diffstat (limited to 'src/components/color.py')
-rw-r--r--src/components/color.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/components/color.py b/src/components/color.py
index f1fb2b2..253ac83 100644
--- a/src/components/color.py
+++ b/src/components/color.py
@@ -1,5 +1,5 @@
from PIL import Image, ImageDraw
-from PyQt5 import uic, QtGui, QtCore, QtWidgets
+from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtGui import QColor
from PIL.ImageQt import ImageQt
import os
@@ -13,8 +13,7 @@ class Component(__base__.Component):
def widget(self, parent):
self.parent = parent
- page = uic.loadUi(os.path.join(
- os.path.dirname(os.path.realpath(__file__)), 'color.ui'))
+ page = self.loadUi('color.ui')
self.color1 = (0, 0, 0)
self.color2 = (133, 133, 133)
@@ -177,7 +176,7 @@ class Component(__base__.Component):
self.sizeWidth, self.sizeHeight
)
painter.end()
- imBytes = image.bits().asstring(image.numBytes())
+ imBytes = image.bits().asstring(image.byteCount())
return Image.frombytes('RGBA', (width, height), imBytes)
def loadPreset(self, pr, presetName=None):