Skip to content

yjg30737/python-stylesheets-color-changer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-stylesheets-color-changer

Python CSS style sheets color changer

Currently the only feature of this is changing the brightness of color of CSS style sheets.

Setup

pip3 install git+https://github.com/yjg30737/python-stylesheets-color-changer.git --upgrade

Included Packages

Class/Method Overview

  • StyleSheetsColorChanger(stylesheets: str) - Constructor. stylesheets argument accepts the raw css code.
  • lighter() -> str - Make colors lighter. #DDD -> #EEE. Return the raw css code which is lighter than the original.
  • darker() -> str - Make colors darker. #EEE -> #DDD. Return the raw css code which is darker than the original.

Example

Example application is pyqt-dark-calculator.

Original

image

I'll make this darker.

Code Sample

from PyQt5.QtWidgets import QApplication
from pyqt_dark_calculator import Calculator
from python_stylesheets_color_changer import StyleSheetsColorChanger


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    calculator = Calculator()
    changer = StyleSheetsColorChanger('darkGrayTheme.css')
    css_code = changer.darker()
    calculator.setStyleSheet(css_code)
    calculator.show()
    app.exec_()

Result

image

How about make it lighter?

image

I know that is hard to distinguish. So i'll show you all three of them at once.

About

Python CSS style sheets color changer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages