当前位置:网站首页>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()
边栏推荐
- MIN_ RTO dialog
- leetcode:1314. Matrix area and [2D prefix and template]
- Operation of ES6
- Intersection traffic priority, illustration of intersection traffic rules
- 精品网址导航主题整站源码 wordpress模板 自适应手机端
- 统计遗传学:第三章,群体遗传
- Architecture practice camp - graduation project of module 9 of phase 6
- (pointeur) Écrivez - vous une fonction qui compare la taille de la chaîne et fonctionne comme strcmp.
- Boutique website navigation theme whole station source code WordPress template adaptive mobile terminal
- UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
猜你喜欢

Many founders of technology companies provided enterpriser first with a round C financing of up to US $158million to help it invest in the next generation of global innovators

微信公众号无限回调授权系统源码

Boutique website navigation theme whole station source code WordPress template adaptive mobile terminal

Experience sharing of epidemic telecommuting | community essay solicitation

1. Mx6u-alpha development board (LED drive experiment in C language version)

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

【云原生】那些看起来很牛X,原理却很简单的一行代码
![[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

The "functional art" jointly created by Bolang and Virgil abloh in 2021 to commemorate the 100th anniversary of Bolang brand will debut during the exhibition of abloh's works in the museum
Tcp- simple understanding of three handshakes and four waves
随机推荐
[wechat applet] good looking carousel map component
GUI 应用:socket 网络聊天室
【安全攻防】序列化与反序列,你了解多少?
Leetcode brush questions: binary tree 05 (flip binary tree)
Tcp- simple understanding of three handshakes and four waves
架构实战营 - 第 6 期 模块九之毕业设计
Precautions for accompanying driving these 23 points should be paid attention to!
Redis:哈希hash类型数据操作命令
FT2000+下LPC中断绑核使用说明
Main applications of TDK lambda power supply
"Don't care too much about salary when looking for a job", this is the biggest lie I've ever heard
戳气球和布尔运算问题(巨难)
精品网址导航主题整站源码 wordpress模板 自适应手机端
1. Mx6u-alpha development board (simulating STM32 drive development experiment)
牛客小白月赛49
leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
B. All Distinct
How to add custom API objects in kubernetes (1)
新手找陪驾要注意什么
1. Mx6u-alpha development board (LED drive experiment in C language version)