Results 1 to 6 of 6

Thread: conversion of color

  1. #1
    Join Date
    Apr 2006
    Posts
    21
    Thanks
    6

    Question conversion of color


    When i save my projet;
    the var : QColor colorwidget is white
    So ,in filesave *.cpp ,the value is 0xbffcc8fc.
    i dont understand the codage of color.......
    white normaly will have the value :255 255 255====>what s the result of this value after coding

    Thanks

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: conversion of color

    These are the hexadecimal values of rgba(red,green,blue and alpha-channel i.e., transparency).

    In your case it should ideally be 0xffffffff

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: conversion of color

    Quote Originally Posted by Stephano

    white normaly will have the value :255 255 255====>what s the result of this value after coding
    0xFFFFFF

    Maybe your coding your white somehow incorrectly or it's not white at all (or it's using some different colourspace than (A)RGB).

  4. #4
    Join Date
    Apr 2006
    Posts
    21
    Thanks
    6

    Default Re: conversion of color

    thanks
    But,in this expression :
    0xbffcc8fc,
    bf --->R
    fc---->G
    c8----->B
    fc----->alpha chanel

    ????that s true or false
    if it s true, can i convert 0x** ** ** **to 0x****.
    thanks to all

  5. #5
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: conversion of color

    Quote Originally Posted by Stephano
    But,in this expression :
    0xbffcc8fc,
    bf --->R
    fc---->G
    c8----->B
    fc----->alpha chanel

    ????that s true or false
    Its true.

    Quote Originally Posted by Stephano
    can i convert 0x** ** ** **to 0x****.
    You can use QColor red(), QColor green(), QColor blue() to get the integer values and play around. Alpha channel by default is 255(ff).

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: conversion of color

    How did you receive that value anyway?

Similar Threads

  1. Using a QFrame as a color selection indicator
    By KShots in forum Qt Tools
    Replies: 8
    Last Post: 14th June 2011, 23:55
  2. button background color when it is clicked
    By navi1084 in forum Qt Programming
    Replies: 4
    Last Post: 9th December 2008, 15:02
  3. how to change backgroup color, button color and shape?
    By lzha022 in forum Qt Programming
    Replies: 10
    Last Post: 16th June 2008, 22:25
  4. Replies: 1
    Last Post: 1st February 2007, 14:32
  5. QLabel background color
    By munna in forum Newbie
    Replies: 3
    Last Post: 1st May 2006, 15:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.