当前位置:网站首页>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()
边栏推荐
- Select function variable column name in dplyr of R language
- leetcode:1314. 矩阵区域和【二维前缀和模板】
- What is the difference between Western Digital Green disk, blue disk, black disk, red disk and purple disk
- Self sharing of a graduate
- Unity资源路径
- Unity Resource path
- Redis: operation command for collecting set type data
- Kivy教程之 格式化文本 (教程含源码)
- The five pictures tell you: why is there such a big gap between people in the workplace?
- 疫情远程办公经验分享| 社区征文
猜你喜欢

Redis:集合Set类型数据的操作命令

疫情远程办公经验分享| 社区征文

R语言dplyr中的Select函数变量列名

Emlog user registration plug-in is worth 80 yuan

Distributed cap theory

The five pictures tell you: why is there such a big gap between people in the workplace?
![[Yugong series] go teaching course 002 go language environment installation in July 2022](/img/a8/79c48e426ce909db960d446f923795.png)
[Yugong series] go teaching course 002 go language environment installation in July 2022

Keysight n9320b RF spectrum analyzer solves tire pressure monitoring scheme

Virtual commodity account trading platform source code_ Support personal QR code collection

Leetcode skimming: binary tree 09 (minimum depth of binary tree)
随机推荐
Tcp- simple understanding of three handshakes and four waves
Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment
Unity Resource path
JS realizes the effect of text scrolling marquee
Redis: operation command for collecting set type data
How to add custom API objects in kubernetes (1)
(pointeur) Écrivez - vous une fonction qui compare la taille de la chaîne et fonctionne comme strcmp.
Dp83848+ network cable hot plug
【安全攻防】序列化与反序列,你了解多少?
The five pictures tell you: why is there such a big gap between people in the workplace?
普源DS1000Z系列数字示波器在通信原理实验中的应用方案
Graduation project
MySQL JDBC编程
Wechat official account infinite callback authorization system source code
RHCSA 01 - 创建分区与文件系统
Architecture training graduation design + summary
牛客小白月赛49
最长递增子序列问题(你真的会了吗)
One click compilation and deployment of MySQL
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon