Comments (5)
This is the wrong function:
slint/internal/core/graphics/color.rs
Line 306 in 2c0ba2b
It is implemented by linearly change all fields, which doesn't work with alpha values.
Instead of doing that, it should call self.mix(target_value, t)
of the opposite
from slint.
The problem here is the interpolation between transparent and some color. It linearly interpolate both the alpha value, and also the color values. But that's wrong because then the "black" color of transparent shows a bit.
Note that .mix
uses a different lagorithm
This example (slintpad) shows the difference between the mix and the animation
component Foo inherits Rectangle {
background: transparent;
states [
hovered when touchArea.has-hover: {
background: lightgray;
}
]
animate background {
duration: 1.0s;
easing: linear;
}
touchArea := TouchArea { }
}
from slint.
Seems like the fix is trivial. I'll submit a PR that uses mix
for color interpolation
from slint.
@ogoffart I submitted a PR with the suggested changes here: #5063
from slint.
Fixed by #5063
Thanks @mitioshi
from slint.
Related Issues (20)
- Add the aibility to reference a component from another one
- [slint-lsp/vscode] action to open the element's document at the cursor's position HOT 4
- OpenCV's highgui::select_roi() function does not render fully when used with Slint (Rust)
- TimePicker widget HOT 2
- LineEdit Widget Error HOT 2
- Quickstart Rust Example Code Display Defect HOT 2
- Using Path in an embedded project will result in a compilation error. HOT 1
- is it possible to express a tree in this type system? HOT 1
- Path: Can't parse commands containing scientific notation HOT 3
- Performance issues using imports vs single .slint file HOT 6
- RFC: date-time builtin type HOT 2
- Component catalogue in Design Mode includes component under preview, resulting in compilation errors on drop HOT 2
- Component catalogue shows user defined duplicates in gallery demo HOT 1
- Built-in VirtualKeyboard element for improved support for in-process embedded virtual keyboards
- A bug with booleans, rust slint. HOT 3
- Android: double-clicked callback not work on TouchArea HOT 2
- Android: default-font-family not work
- Support libraries in LSP
- Compiler panic compiling `init` callback from a component inlined into a repeater HOT 1
- Include LTS Version as slintpad dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slint.