1

I use a linear gradient to colorize a rectangle. On my Display (480px, EGLFS) i can clearly see 16 color-steps (see picture). Is there a way to increase the number of steps to have a more fluid gradient.

bad gradient

Rectangle {
    width: 800
    height: 480
    gradient: Gradient{
        GradientStop{position: 1.0; color: "#404040"}
        GradientStop{position: 0.0; color: "black"}
    }
}
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Mat
  • 11
  • 2
  • 1
    Is it any better if you add a GradientStop at the mid point (position 0.5) with a colour half way between #404040 and black? Also what if you embed it inside a LinearGradient? http://doc.qt.io/qt-5/qml-qtgraphicaleffects-lineargradient.html – teh_raab Dec 21 '18 at 11:13

1 Answers1

0

The problem was, that the gradient has more colors than the display can show (850 for 256). This is called colour banding (https://en.wikipedia.org/wiki/Colour_banding). After reducing the colors by using an indicated .png instead of the gradient it looks ok.

Mat
  • 11
  • 2