当前位置:网站首页>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()
边栏推荐
- Keysight N9320B射频频谱分析仪解决轮胎压力监测方案
- [cloud native] those lines of code that look awesome but have a very simple principle
- JS realizes the effect of text scrolling marquee
- 苹果CMS仿西瓜视频大气响应式视频模板源码
- 疫情远程办公经验分享| 社区征文
- Leetcode brush questions: binary tree 05 (flip binary tree)
- What is context?
- Kivy教程之 07 组件和属性绑定实现按钮button点击修改label组件(教程含源码)
- (pointer) write a function to compare the size of strings by yourself, which is similar to StrCmp.
- 架构实战营 - 第 6 期 模块九之毕业设计
猜你喜欢
Formatted text of Kivy tutorial (tutorial includes source code)
Redis:哈希hash类型数据操作命令
Select function variable column name in dplyr of R language
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
【愚公系列】2022年7月 Go教学课程 001-Go语言前提简介
普源DS1000Z系列数字示波器在通信原理实验中的应用方案
Leetcode brush question: binary tree 06 (symmetric binary tree)
【微信小程序】好看的轮播图组件
Virtual commodity account trading platform source code_ Support personal QR code collection
Kivy教程之 格式化文本 (教程含源码)
随机推荐
Dp83848+ network cable hot plug
Senior developers tell you, how to write excellent code?
What does software testing do? Find defects and improve the quality of software
I.MX6U-ALPHA开发板(模仿STM32驱动开发实验)
RHCSA 03 - 文件的基础权限
The five pictures tell you: why is there such a big gap between people in the workplace?
统计遗传学:第三章,群体遗传
普源DS1000Z系列数字示波器在通信原理实验中的应用方案
Statistical genetics: Chapter 3, population genetics
96% of the collected traffic is prevented by bubble mart of cloud hosting
Rhcsa 03 - Basic permissions for documents
y55.第三章 Kubernetes从入门到精通 -- HPA控制器及metrics-server(二八)
Kivy教程之 更改背景颜色(教程含源码)
Why use node
tdk-lambda电源主要应用
仿《游戏鸟》源码 手游发号评测开服开测合集专区游戏下载网站模板
Tcp- simple understanding of three handshakes and four waves
Y55. Chapter III kubernetes from entry to proficiency -- HPA controller and metrics server (28)
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
Longest increasing subsequence problem (do you really know it)