Author Topic: Code Snippet - Seperate RGB Values from colour  (Read 2182 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
I needed to do this for my destruction challenge entry amd I couldn't find a snippet to do it so I've written one.

If takes a colour and seperates it into seperate RGB values so you can do stuff to them and then recombine using the rgb satement;

Code: [Select]
            ORG=Original_Colour
            SB = (ORG AND &HFF)
            SG = ((ORG AND &HFF00) SHR 8)
            SR = ((ORG AND &HFF0000) SHR 16)
Shockwave ^ Codigos
Challenge Trophies Won: