当前位置:网站首页>Change the background color of Kivy tutorial (tutorial includes source code)
Change the background color of Kivy tutorial (tutorial includes source code)
2022-07-04 04:36:00 【Knowledge fatness】
We will adjust the window background color . Window background (OpenGL Of the renderer “ Clear color ”) It's the whole picture Window Object properties . To change it , We are below __name__ == 'main’ Add this code after line main.py:
from kivy.core.window import Window
from kivy.utils import get_color_from_hex
Window.clearcolor = get_color_from_hex('#101216')
Combat code
import kivy
from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.utils import get_color_from_hex
#Window.clearcolor = [1, 1, 1, 1]
Window.clearcolor = get_color_from_hex("#ffffff")
kvcode = """
#:import C kivy.utils.get_color_from_hex
<[email protected]>:
size_hint: .2, .3
canvas.before:
Color:
rgba: C("#22FFAA")
Rectangle:
pos: self.pos
size: self.size
FloatLayout:
FVerde:
pos_hint:{"x":.4, "y":.4}
"""
class JanelaApp(App):
def build(self):
return Builder.load_string(kvcode)
janela = JanelaApp()
janela.run()
边栏推荐
- "Don't care too much about salary when looking for a job", this is the biggest lie I've ever heard
- Emlog用户注册插件 价值80元
- 西部数据绿盘、蓝盘、黑盘、红盘和紫盘有什么区别
- Leetcode skimming: binary tree 09 (minimum depth of binary tree)
- Rhcsa 06 - suid, sgid, sticky bit (to be added)
- RHCSA 03 - 文件的基础权限
- Unity Resource path
- [security attack and Defense] how much do you know about serialization and deserialization?
- NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
- 十字路口通行优先权,十字路口通行规则图解
猜你喜欢
What is context?
96% of the collected traffic is prevented by bubble mart of cloud hosting
Main applications of TDK lambda power supply
Senior developers tell you, how to write excellent code?
Leetcode brush questions: binary tree 05 (flip binary tree)
5张图告诉你:同样是职场人,差距怎么这么大?
Intersection traffic priority, illustration of intersection traffic rules
ModStartBlog 现代化个人博客系统 v5.2.0 源码下载
[Yugong series] go teaching course 002 go language environment installation in July 2022
十字路口通行优先权,十字路口通行规则图解
随机推荐
戳气球和布尔运算问题(巨难)
(指針)自己寫一個比較字符串大小的函數,功能與strcmp類似。
Pytest basic self-study series (I)
Rhcsa 04 - process management
“找工作不要太在意工资”,这是我听过最大的谎言
Rhcsa 07 - user and group management
Self sharing of a graduate
[microservices openfeign] two degradation methods of feign | fallback | fallbackfactory
西部数据绿盘、蓝盘、黑盘、红盘和紫盘有什么区别
Virtual commodity account trading platform source code_ Support personal QR code collection
Kivy tutorial custom fonts (tutorial with source code)
Experience sharing of epidemic telecommuting | community essay solicitation
R语言中如何查看已安装的R包
1. Mx6u-alpha development board (LED drive experiment in C language version)
dried food! Generation of rare samples based on GaN
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
Leetcode brush questions: binary tree 05 (flip binary tree)
RPC Technology
更优雅地远程操作服务器:Paramiko库的实践
Leetcode brush question: binary tree 06 (symmetric binary tree)