Introduction to Qt / QML (Part 12) - Colors and Gradients

Опубликовано: 05 Октябрь 2024
на канале: KDAB
17,033
279

We have already seen how to make colored rectangles: just write something like "color: "red"" in your QML code. Is that all that Qt Quick offers in terms of colors? Well, not quite. This video shows you how to specify colors in different ways (e.g. by an HTML hex-string, or by specifying RGB channels using normalized floating point) and create gradients in Qt Quick.

Don't underestimate these little graphical touches; they can truly make the difference between a good looking application and a great looking application.

Dithering and banding of gradients is also discussed. If you want to know more about those topics, check out these articles on Wikipedia: https://en.wikipedia.org/wiki/Dither and https://en.wikipedia.org/wiki/Colour_...

You can find the mentioned video about "FocusScope" here:    • Introduction to Qt / QML (Part 22) - ...  

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv

00:00 Introduction
00:42 Colors
01:59 Gradients
05:29 Gradient Images

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrolment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at [email protected] or visit our website: https://www.kdab.com/software-service...

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/