Added an API method to get and set the document background color
ClosedPublic

Authored by jhoolmans on May 6 2018, 6:44 PM.

Details

Reviewers
rempt
Group Reviewers
Krita
Summary

BUG 393754

Test Plan
  1. Create a new document with white or black background color set.
  2. Use Scripter to run:
from krita import Krita
from PyQt5.QtGui import QColor

kt = Krita.instance()
doc = kt.activeDocument()

test_color = QColor(128, 128, 128, 255)  # change as needed

old_background = doc.backGroundColor()
print("Old background: {}".format(old_background.getRgb()))

doc.setBackGroundColor(test_color)

new_background = doc.backGroundColor()
print("New background {}".format(new_background.getRgb()))
  1. Change test_color to see canvas update accordingly.

Diff Detail

Repository
R37 Krita
Branch
jhoolmans/document-background-color-api
Lint
No Linters Available
Unit
No Unit Test Coverage
jhoolmans requested review of this revision.May 6 2018, 6:44 PM
jhoolmans created this revision.
jhoolmans edited the test plan for this revision. (Show Details)May 6 2018, 6:58 PM
jhoolmans added a reviewer: Krita.
jhoolmans added a project: Krita.
Restricted Application added a subscriber: woltherav. · View Herald TranscriptMay 6 2018, 6:58 PM
rempt accepted this revision.May 7 2018, 7:39 AM
rempt added a subscriber: rempt.

Looks fine to me. I'll merge the change today.

This revision is now accepted and ready to land.May 7 2018, 7:39 AM