当前位置:网站首页>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()
边栏推荐
- Kivy tutorial custom fonts (tutorial with source code)
- Boutique website navigation theme whole station source code WordPress template adaptive mobile terminal
- Leetcode skimming: binary tree 04 (sequence traversal of binary tree)
- Rhcsa 04 - process management
- 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
- The interactive solution of JS and app in the H5 page embedded in app (parameters can be transferred and callbacks can be made)
- Main applications of TDK lambda power supply
- dried food! Generation of rare samples based on GaN
- Leetcode brush question: binary tree 06 (symmetric binary tree)
- Operation of ES6
猜你喜欢

最长递增子序列问题(你真的会了吗)

Experience sharing of epidemic telecommuting | community essay solicitation

UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence

多位科技公司创始人向Entrepreneur First提供高达1.58亿美元的C轮融资,协助其投资下一代全球创新者

【微信小程序】好看的轮播图组件

Leetcode skimming: binary tree 09 (minimum depth of binary tree)

Leetcode skimming: binary tree 07 (maximum depth of binary tree)

R语言中如何查看已安装的R包
![[microservice openfeign] @feignclient detailed explanation](/img/8d/83bcde1355366c7c88a7a9ade7f9eb.png)
[microservice openfeign] @feignclient detailed explanation

两万字带你掌握多线程
随机推荐
Kivy教程之 格式化文本 (教程含源码)
微信脑力比拼答题小程序_支持流量主带最新题库文件
One click compilation and deployment of MySQL
Redis: order collection Zset type data operation command
[microservices openfeign] two degradation methods of feign | fallback | fallbackfactory
Unity draws the trajectory of pinball and billiards
MySQL JDBC编程
Asynchronous development process - touch your hand and lead you to realize a promise
更优雅地远程操作服务器:Paramiko库的实践
C language bidirectional linked list first edition
Self sharing of a graduate
最长递增子序列问题(你真的会了吗)
优秀的测试/开发程序员是怎么修炼的?该往哪走......
Instructions for LPC interrupt binding under ft2000+
【云原生】那些看起来很牛X,原理却很简单的一行代码
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
什么是上下文?
Krypton saikr daily question - CTF
Touch and take you to implement an EventEmitter
Distributed cap theory