Thread: Allegro and color commands

  1. #1
    Registered User
    Join Date
    Jan 2006
    Location
    Planet X
    Posts
    12

    Question Allegro and color commands

    I know how specify what color I want to set to a pixle in Allegro, but I was woundering, is there a way to record what the color of specific pixle is?

    I use the command:

    color=makecol(red,green,blue);

    to set the color for a comand like:

    line(screen,x1,y1,x2,y2,color);

    what I want it do is either detect what 'red', 'green', and 'blue' of a specific pixle or 'color' of the pixle

    Thanks,
    Campsoup1988

    PS: if this is the wrong section for the question, I am sorry, and if you could move it to the correct section

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Dosen't allegro have a getpixel function?

  3. #3
    Registered User
    Join Date
    Jan 2006
    Location
    Planet X
    Posts
    12
    Quote Originally Posted by Quantum1024
    Dosen't allegro have a getpixel function?
    I dont know. what is the function?

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    You can find the getpixel function in the allegro docs
    http://www.talula.demon.co.uk/allegr.../alleg013.html
    Once you have the pixel value in a variable you can seperate it into it's componant colors by and'ing/bitshifts.

  5. #5
    Registered User
    Join Date
    Jan 2006
    Location
    Planet X
    Posts
    12
    ok, but I want to know what the color of the pixle is already not how to change it

Popular pages Recent additions subscribe to a feed