Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   WPF Transparent Colors (http://www.velocityreviews.com/forums/t711125-wpf-transparent-colors.html)

tshad 01-08-2010 04:02 PM

WPF Transparent Colors
 
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 01-08-2010 07:23 PM

Re: WPF Transparent Colors
 
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" <tfs@dslextreme.com> a écrit dans le message de
news:OC3o8vHkKHA.5568@TK2MSFTNGP02.phx.gbl...
>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 01-09-2010 07:02 AM

Re: WPF Transparent Colors
 

"Patrice" <http://scribe-en.blogspot.com/> wrote in message
news:uSaIYgJkKHA.1864@TK2MSFTNGP05.phx.gbl...
> 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" <tfs@dslextreme.com> a écrit dans le message de
> news:OC3o8vHkKHA.5568@TK2MSFTNGP02.phx.gbl...
>>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 01-09-2010 10:00 AM

Re: WPF Transparent Colors
 
> 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


tshad 01-09-2010 05:16 PM

Re: WPF Transparent Colors
 

"Patrice" <http://scribe-en.blogspot.com/> wrote in message
news:%238lWDKRkKHA.4912@TK2MSFTNGP02.phx.gbl...
>> 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




Patrice 01-09-2010 05:45 PM

Re: WPF Transparent Colors
 
Thanks for the follow up. I never wondered as I'm always using 6 or 8
digits.

--
Patrice



All times are GMT. The time now is 06:31 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.