Adding Alpha value to hex color
#1

How do I make that 0x88CC44FF becomes for example 0x88CC4477?
Reply
#2

Pretty sure you need bitwise AND: &
Reply
#3

0xCC0000FF, the part being HEX. Woops, now that I tried it, the alpha/transparency does not work with it.
Reply
#4

Quote:
Originally Posted by Stylock
Посмотреть сообщение
Pretty sure you need bitwise AND: &
As far as I know bitwise AND is used for something else.
Reply
#5

This might help you.
Reply
#6

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
As far as I know bitwise AND is used for something else.
Then you don't know far enough.

EDIT: ******, I think it's more difficult to understand how substraction works with hex than with normal numbers.
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
You want to make a number smaller? This is commonly known as "subtraction", and taught to school children when they are like 5!
Nice answer

Quote:
Originally Posted by Stylock
Посмотреть сообщение
Then you don't know far enough.
Sorry i thought they are used to compare something. Well how would you do it then?
Reply
#8

This returns alpha:
Код:
0x88CC4488 & 0x000000FF
Reply
#9

I think you literally have to minus 8 from the number.. (F = 15 so 15 - 8 = 7)
Reply
#10

0x88 to be precise, not 8 as a decimal.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)