[sdk] MainView background doesn't have the correct color when set to a light color

Bug #1203066 reported by londumas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UX
Fix Committed
Medium
Jouni Helminen
ubuntu-ui-toolkit (Ubuntu)
Fix Released
Medium
Tim Peeters

Bug Description

If on a Page, you set a background to a yellow based color like "yellow" and you set also a button and a rectangle to the same color, you can see that the color of the background isn't the good one. Compare the color here: http://www.colorhexa.com/ffff00 to the color of the background of the attached picture. When you do the same for other colors like "black", "green", "blue" everything is perfect.

See attached code and screenshot.

[edit] the button and the rectangle are only here to show you the color difference. But the problem is still true only with the background: the color isn't the required one.

Revision history for this message
londumas (helion331990) wrote :
Revision history for this message
londumas (helion331990) wrote :

here the scrrenshot

description: updated
description: updated
Revision history for this message
Tim Peeters (tpeeters) wrote :

With this code you can see that "yellow" (or #ffff00) is different in a MainView and a Rectangle:

import QtQuick 2.2
import Ubuntu.Components 1.1

MainView {
    id: mainView
    property string color: "yellow"
    backgroundColor: "#ffff00"

    width: units.gu(100)
    height: units.gu(75)

    Page {
        title: i18n.tr("Simple")

        Rectangle {
            anchors.centerIn: parent
            color: "yellow"
            width: 100
            height: 100
        }

        Column {
            spacing: units.gu(1)
            anchors {
                margins: units.gu(2)
                fill: parent
            }

            Button {
                id: button1
                text: i18n.tr("Tap me!")
                color: mainView.color
                onClicked: print(mainView.backgroundColor, button1.color)
            }
            Rectangle{
                width: units.gu(10)
                height: units.gu(10)
                color: mainView.color
            }
        }
    }
}

Changed in ubuntu-ui-toolkit:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Tim Peeters (tpeeters) wrote :

to reproduce:

import QtQuick 2.2
import Ubuntu.Components 1.1

MainView {
    id: mainView
    property string color: "white"
    backgroundColor: color

    width: units.gu(100)
    height: units.gu(75)

    Page {
        title: i18n.tr("Simple")

        Rectangle {
            anchors.centerIn: parent
            color: mainView.color
            width: 100
            height: 100
        }
    }
}

summary: - [color] background doesn't have the good color when set to "yellow" (or
- derivated color)
+ MainView background doesn't have the correct color when set to a light
+ color
Revision history for this message
Tim Peeters (tpeeters) wrote : Re: MainView background doesn't have the correct color when set to a light color

MainViewStyle has a backgroundSource property which refers to an image which is drawn over the background color. Removing that fixes the issue.

Design, do we want to always draw this background (paper) texture?

Changed in ubuntu-ux:
status: New → Triaged
assignee: nobody → Jouni Helminen (jounihelminen)
summary: - MainView background doesn't have the correct color when set to a light
- color
+ [sdk] MainView background doesn't have the correct color when set to a
+ light color
Zoltan Balogh (bzoltan)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Zoltan Balogh (bzoltan)
no longer affects: ubuntu-ui-toolkit
Changed in ubuntu-ux:
importance: Undecided → Medium
Mathew Hodson (mhodson)
tags: added: running-unity
removed: background color
Revision history for this message
Jouni Helminen (jounihelminen) wrote :

"MainViewStyle has a backgroundSource property which refers to an image which is drawn over the background color. Removing that fixes the issue.

Design, do we want to always draw this background (paper) texture?"

Let's remove any paper texture if it's still there please

Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: nobody → Tim Peeters (tpeeters)
Changed in ubuntu-ux:
status: Triaged → Fix Committed
Revision history for this message
Tim Peeters (tpeeters) wrote :

This is fixed in UITK 1.3.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.