Results 1 to 5 of 5

Thread: Palette switching

  1. #1

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181

    Palette switching

    Hey everyone
    well I made some little thingy that works with 8 bit colors in DX7. Well I finally managed to do some palette switching, now I would like to know how I should edit the pallets to change the colors slowly from one to another...
    I hope you get what I want
    it can be seen in many winamp visualizations and stuff like that...
    Sanity is a full time job

    Puh das war harter Stoff!

  2. #2
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    PlatteSwitching was a common way to do animation - let the display drivers do all the work for you (sim city 2000 used it)

    if you want to fade from one colout to another, just slowly change the 8 bit colour value towards he colour your heading for

    remember very palette entry you change, changes ALL the pixels that use that entry.
    Some Days, i just get this feeling that i'm helping to write dozens of Viruses...

  3. #3

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    thanks
    well I do know about that.
    What I want to do is switch all the palette values so I have a slow fade from one color to another... (will all its modulations...)
    Sanity is a full time job

    Puh das war harter Stoff!

  4. #4
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    Well for a 24bit colour value you got:

    &HFFFFFF 'white

    and &H000000 'black

    if you want to fade between then them in 16 frames

    then it would simply be values:

    &HFFFFFF
    &HEEEEE
    &HDDDDD
    &HCCCCC
    &HBBBBBB
    &HAAAAAA
    &H999999
    &H888888
    ...
    ...
    &H111111
    &H000000

    for Red:

    FF0000:

    to green

    0000FF

    in three steps then each step is

    (red - green) /3

    so FF0000 - 0000FF = FEFF01

    FEFF01 / 3 = 54FFAB

    so the values would be

    ff0000 - 54FFAB
    = AA0055 - 54FFAB
    = 5500AA - 54FFAB
    = 0000FF
    Some Days, i just get this feeling that i'm helping to write dozens of Viruses...

  5. #5

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    alright I think I got you
    I am using only 8bit, but that should work too
    thanks for the help
    I am sure to be back for some further questions about that real soon
    Sanity is a full time job

    Puh das war harter Stoff!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width