Colour Values

Discussion in 'Questions (Windows Mobile)' started by Zenerdiode, May 19, 2008.

  1. Zenerdiode

    Zenerdiode Active Member Licensed User

    I'm busy building an app that users answer questions on a 1 to 5 scale. Various averages are done to give a final score - a decimal value between 1 and 5. I then wanted to present the result in a colour ranging from red for 1, through yellow to green for 5. I've managed this - attached is an example demo - however, it reminds me of a recent post by TWELVE about a function sub returning more than one variable.

    I've accomplished my task with two subs; one for the red value and one for the green, I was then thinking of using the integer value representing the colour and manipulating that, so I could use "Label1.FontColor=integer" instead of "Label1.FontColor=r,g,b" but I can't see how the integer is derived.
     

    Attached Files:

  2. colin9876

    colin9876 Active Member Licensed User

    nice

    Nice bit of coding there.
    The number shown on ur form is the negative integer that represents the colour, the conversions done by int = R*256*256 +G*256 +B or something like that and the signed bit makes it show as negative
     
    Last edited: May 20, 2008
  3. Erel

    Erel Administrator Staff Member Licensed User

    You can use the GetRGB method to find the three components of a color.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice