Welcome, Guest. Please login or register.

Author Topic: Convert #COCOCO to #xxxxxxxx  (Read 2042 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show all replies
Convert #COCOCO to #xxxxxxxx
« on: October 25, 2010, 07:24:39 PM »
I would like to know how i can convert hex #C0C0C0 to the Amigas hex equivilent of #xxxxxxxx which is 8 digits per color instead of 2. For example red green blue is normally C0,C0,C0 or red = C0(192), green = C0(192), blue C0(192) or #COCOCO  in full notation. However the amiga reques that functions such as ObtainBestPenA have the color in hex as #FFFFFFFF, #FFFFFFFF, FFFFFFFF or red = #FFFFFFFF(4294967295), green = #FFFFFFFF(4294967295), blue = #FFFFFFFF(4294967295) or:
Code: [Select]
ObtainBestPenA(GameWindow->WScreen->ViewPort.ColorMap, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, NULL);
except i want to convert different hex colors like:
Quote
#C0C0C0
#208040
#005b7f
Any help in this matter would be greatly appreciated.
 
Omega Space Protons
 

Offline Omega Space ProtonsTopic starter

  • Newbie
  • *
  • Join Date: Oct 2010
  • Posts: 41
    • Show all replies
Re: Convert #COCOCO to #xxxxxxxx
« Reply #1 on: October 25, 2010, 07:40:42 PM »
Thanks and if understand correctly,
 
#208040 would be:
Quote
#20202020
#80808080
#40404040

#C0C0C0 would be:
Quote
#C0C0C0C0
#C0C0C0C0
#C0C0C0C0

#005b7f would be:
Quote
#00000000
#5b5b5b5b
#7f7f7f7f

#FFFFFF would be:
Quote
#FFFFFFFF
#FFFFFFFF
#FFFFFFFF

Is this correct or am i missing something else?
 
Omega Space Protons