Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > WPF Transparent Colors

Reply
Thread Tools

WPF Transparent Colors

 
 
tshad
Guest
Posts: n/a
 
      01-08-2010
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


 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      01-08-2010
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
>


 
Reply With Quote
 
 
 
 
tshad
Guest
Posts: n/a
 
      01-09-2010

"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
>>

>



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      01-09-2010
> 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

 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      01-09-2010

"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



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      01-09-2010
Thanks for the follow up. I never wondered as I'm always using 6 or 8
digits.

--
Patrice

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any library that can convert RGB colors to ANSI colors? ZelluX Python 3 12-01-2008 11:08 AM
TreeNode colors come from anchor colors AAaron123 ASP .Net 1 08-07-2008 07:56 PM
WPF on website? brett ASP .Net 1 11-24-2006 09:02 AM
WPF asp.net 2.0 hector.caban@gmail.com ASP .Net 0 05-24-2006 08:37 PM
Using Transparent Colors in Dynamic pictures. (GDI+) Chris Tremblay ASP .Net 1 08-21-2004 07:40 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57