当前位置:网站首页>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()
边栏推荐
猜你喜欢
Redis:有序集合zset类型数据操作命令
Statistical genetics: Chapter 3, population genetics
[security attack and Defense] how much do you know about serialization and deserialization?
两万字带你掌握多线程
Leetcode brush questions: binary tree 05 (flip binary tree)
架构训练毕业设计+总结
FT2000+下LPC中断绑核使用说明
Ppt tutorial, how to save a presentation as a PDF file in PowerPoint?
精品网址导航主题整站源码 wordpress模板 自适应手机端
Leetcode skimming: binary tree 09 (minimum depth of binary tree)
随机推荐
[Yugong series] go teaching course 001 in July 2022 - Introduction to go language premise
Senior developers tell you, how to write excellent code?
Keysight n9320b RF spectrum analyzer solves tire pressure monitoring scheme
Experience sharing of epidemic telecommuting | community essay solicitation
Longest increasing subsequence problem (do you really know it)
B. All Distinct
C language bidirectional linked list first edition
How to add custom API objects in kubernetes (1)
Ppt tutorial, how to save a presentation as a PDF file in PowerPoint?
Rhcsa 01 - create partitions and file systems
浅谈一篇优质的小红书文案需要具备什么
tdk-lambda电源主要应用
Y55. Chapter III kubernetes from entry to proficiency -- HPA controller and metrics server (28)
Eig launched Grupo Cerro, a renewable energy platform in Chile
EventBridge 在 SaaS 企业集成领域的探索与实践
How to add custom API objects in kubernetes (1)
西部数据绿盘、蓝盘、黑盘、红盘和紫盘有什么区别
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
优秀的测试/开发程序员是怎么修炼的?该往哪走......
Unity Resource path