WPF Transparent Colors

Discussion in 'ASP .Net' started by tshad, Jan 8, 2010.

  1. tshad

    tshad Guest

    I was playing with transparent colors and was wondering why:

    #50C6 is transparent (Light green)
    #50C6C6 is not transparent (Light Blue)
    #50C6C6C6 is transparent (Light Gray)

    I had been told the format was #00xxxxxx, but the first one is not in that
    format so why is it transparent?

    Thanks,

    Tom
    tshad, Jan 8, 2010
    #1
    1. Advertising

  2. tshad

    Patrice Guest

    Hello,

    I gave this a try and it seems that #ABCD is taken as #AABBCCDD. So IMO your
    best bet is to always use 6 or 8 hexadecimal digits.

    As a side note #50C6C6C6 is partially transparent (transparency goes from
    #00 for fully transparent to #FF for fully opaque).

    --
    Patrice

    "tshad" <> a écrit dans le message de
    news:...
    >I was playing with transparent colors and was wondering why:
    >
    > #50C6 is transparent (Light green)
    > #50C6C6 is not transparent (Light Blue)
    > #50C6C6C6 is transparent (Light Gray)
    >
    > I had been told the format was #00xxxxxx, but the first one is not in that
    > format so why is it transparent?
    >
    > Thanks,
    >
    > Tom
    >
    Patrice, Jan 8, 2010
    #2
    1. Advertising

  3. tshad

    tshad Guest

    "Patrice" <http://scribe-en.blogspot.com/> wrote in message
    news:...
    > Hello,
    >
    > I gave this a try and it seems that #ABCD is taken as #AABBCCDD. So IMO
    > your best bet is to always use 6 or 8 hexadecimal digits.
    >

    Is 6 assumed to have a 2 digits before it (FF) so it is not transparent?

    > As a side note #50C6C6C6 is partially transparent (transparency goes from
    > #00 for fully transparent to #FF for fully opaque).


    So the last 6 characters are the color and the 1st 2 (if there are 8
    characters) are for transparency?

    Thanks,

    Tom
    >
    > --
    > Patrice
    >
    > "tshad" <> a écrit dans le message de
    > news:...
    >>I was playing with transparent colors and was wondering why:
    >>
    >> #50C6 is transparent (Light green)
    >> #50C6C6 is not transparent (Light Blue)
    >> #50C6C6C6 is transparent (Light Gray)
    >>
    >> I had been told the format was #00xxxxxx, but the first one is not in
    >> that format so why is it transparent?
    >>
    >> Thanks,
    >>
    >> Tom
    >>

    >
    tshad, Jan 9, 2010
    #3
  4. tshad

    Patrice Guest

    > Is 6 assumed to have a 2 digits before it (FF) so it is not transparent?

    Yes.

    >> As a side note #50C6C6C6 is partially transparent (transparency goes from
    >> #00 for fully transparent to #FF for fully opaque).

    >
    > So the last 6 characters are the color and the 1st 2 (if there are 8
    > characters) are for transparency?


    Correct.

    I'm not that fluent with WPF. My approach was just to set the color value in
    the XAML file and have some code to display the actual value...

    --
    Patrice
    Patrice, Jan 9, 2010
    #4
  5. tshad

    tshad Guest

    "Patrice" <http://scribe-en.blogspot.com/> wrote in message
    news:%...
    >> Is 6 assumed to have a 2 digits before it (FF) so it is not transparent?

    >
    > Yes.
    >
    >>> As a side note #50C6C6C6 is partially transparent (transparency goes
    >>> from #00 for fully transparent to #FF for fully opaque).

    >>
    >> So the last 6 characters are the color and the 1st 2 (if there are 8
    >> characters) are for transparency?

    >
    > Correct.
    >
    > I'm not that fluent with WPF. My approach was just to set the color value
    > in the XAML file and have some code to display the actual value...
    >

    You can use 3, 4, 6 or 8.. But only 4 or 8 would be transparent. 3 works
    because it can double to 6. 1,2, 5 or 7 are invalid I assume because you
    can't make 6 or 8 from 5 or 7 and 1 and 2 don't have enough information.
    They do generate an error. Although I would have thought 2 would work, BB
    could be BBBBBB.

    Thanks,

    Tom
    > --
    > Patrice
    tshad, Jan 9, 2010
    #5
  6. tshad

    Patrice Guest

    Thanks for the follow up. I never wondered as I'm always using 6 or 8
    digits.

    --
    Patrice
    Patrice, Jan 9, 2010
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Tremblay
    Replies:
    1
    Views:
    602
  2. WPF asp.net 2.0

    , May 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,709
  3. brett

    WPF on website?

    brett, Nov 23, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,321
    Laurent Bugnion
    Nov 24, 2006
  4. AAaron123

    TreeNode colors come from anchor colors

    AAaron123, Aug 7, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    527
    darrel
    Aug 7, 2008
  5. ZelluX
    Replies:
    3
    Views:
    1,857
    Peter Otten
    Dec 1, 2008
Loading...

Share This Page