当前位置:网站首页>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()
边栏推荐
- Modstartblog modern personal blog system v5.2.0 source code download
- Asahi Kasei participated in the 5th China International Import Expo (5th ciie) for the first time
- (pointeur) Écrivez - vous une fonction qui compare la taille de la chaîne et fonctionne comme strcmp.
- Y55. Chapter III kubernetes from entry to proficiency -- HPA controller and metrics server (28)
- EIG在智利推出可再生能源平台Grupo Cerro
- Main applications of TDK lambda power supply
- Senior developers tell you, how to write excellent code?
- How to view installed r packages in R language
- Instructions for LPC interrupt binding under ft2000+
- Kivy教程之 07 组件和属性绑定实现按钮button点击修改label组件(教程含源码)
猜你喜欢
Formatted text of Kivy tutorial (tutorial includes source code)
微信公众号无限回调授权系统源码
【云原生】那些看起来很牛X,原理却很简单的一行代码
Leetcode skimming: binary tree 04 (sequence traversal of binary tree)
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
架构训练毕业设计+总结
RPC Technology
How to view installed r packages in R language
Emlog用户注册插件 价值80元
精品网址导航主题整站源码 wordpress模板 自适应手机端
随机推荐
Deep parsing structured exception handling (SEH) - by Matt Pietrek
How to view installed r packages in R language
Eig launched Grupo Cerro, a renewable energy platform in Chile
Why use node
Detailed explanation of event cycle
普源DS1000Z系列数字示波器在通信原理实验中的应用方案
架构训练毕业设计+总结
苹果CMS仿西瓜视频大气响应式视频模板源码
2021 RSC | Drug–target affinity prediction using graph neural network and contact maps
Keysight N9320B射频频谱分析仪解决轮胎压力监测方案
y55.第三章 Kubernetes从入门到精通 -- HPA控制器及metrics-server(二八)
Precautions for accompanying driving these 23 points should be paid attention to!
MySQL 索引和事务
Exploration and practice of eventbridge in the field of SaaS enterprise integration
First knowledge of batch processing
Touch your hand and bring you a commonjs specification
[Yugong series] go teaching course 001 in July 2022 - Introduction to go language premise
5张图告诉你:同样是职场人,差距怎么这么大?
RHCSA 03 - 文件的基础权限
What is context?