当前位置:网站首页>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()
边栏推荐
- Rhcsa 04 - process management
- Tcp- simple understanding of three handshakes and four waves
- I.MX6U-ALPHA开发板(C语言版本LED驱动实验)
- Leetcode brush questions: binary tree 05 (flip binary tree)
- Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment
- (指針)自己寫一個比較字符串大小的函數,功能與strcmp類似。
- 统计遗传学:第三章,群体遗传
- Formatted text of Kivy tutorial (tutorial includes source code)
- Unity资源路径
- Pytest basic self-study series (I)
猜你喜欢

架构训练毕业设计+总结

I.MX6U-ALPHA开发板(C语言版本LED驱动实验)

苹果CMS仿西瓜视频大气响应式视频模板源码

A beautiful API document generation tool

微信脑力比拼答题小程序_支持流量主带最新题库文件

R语言dplyr中的Select函数变量列名

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

Experience sharing of epidemic telecommuting | community essay solicitation

tdk-lambda电源主要应用

Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment
随机推荐
Operation of ES6
【愚公系列】2022年7月 Go教学课程 001-Go语言前提简介
两万字带你掌握多线程
2021 RSC | Drug–target affinity prediction using graph neural network and contact maps
Use NRM and NVM to manage your NPM source and node versions
Network - vxlan
博朗与Virgil Abloh于2021年为纪念博朗品牌100周年而联合打造的“功能性艺术”将在博物馆展出Abloh作品期间首次亮相
【安全攻防】序列化与反序列,你了解多少?
Main applications of TDK lambda power supply
浅谈JVM的那些事
陪驾注意事项 这23点要注意!
多位科技公司创始人向Entrepreneur First提供高达1.58亿美元的C轮融资,协助其投资下一代全球创新者
RHCSA 04 - 进程管理
Imitation of "game bird" source code, mobile game issue evaluation, open service, open test collection, game download website template
虚拟商品帐号交易平台源码_支持个人二维码收款
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
一个漂亮的API文档生成工具
架构训练毕业设计+总结
【微信小程序】好看的轮播图组件
RHCSA 03 - 文件的基础权限