Hello, this is just some minor issue but i would like to know it so i don't have to go trough the extra work of assigning the color with a color function in a variable.

i know that 0 is black but all the other numbers i have tried to put in gave me unpredictable results, i tried to get white but no luck.

How does the int color system work?

    It depends on what you are trying to do, but in general you would be dealing with some variation of RGB colour coding.

    0 means some minimum (e.g. none) value for that colour, and 255 (or 0xFF, in hexadecimal) means some maximum value for that colour.

    Since white is the combination of all the colours, it can be seen as the maximum of all the colours, so white is (255, 255, 255), or perhaps 0xFFFFFF

      I understand, i have used that kind of color coding to indirecty assign an int color to a function that needs int format colors. I have tried to put it in directly with those color codings but with no success. Are you saying that if i put it between () it would work? Like this; (255, 255, 255).

        I understand, i have used that kind of color coding to indirecty assign an int color to a function that needs int format colors.

        And which function might that be? From GD?

          255,255,255 is the octal representation of white where (000,000,000) would be black in using RGB (Red, Green, Blue)
          but normally colors are referred to in HEX(idecimal) and in HTML white would be referred to as #FFFFFF such as <body bgcolor=#FFFFFF > So it really depends on how you are writing your code but most likely you will either be using HEX or a named color you could just as easily write <body bgcolor =white> and it would work.

          You might want to do a search for HTML color values or HEX color values with Google, but not seeing the code you have it would be hard to tell you how to get the result you want.

            I don't remember. i have to check when i'm at home. But it doesn't matter realy does it? The point is that it expects and intreger color value, i just like to get to the bottom of things so i asked the question.

            It is most likely a gd function yes, i tried to look it up and see if i could remember the exact funtion but i couldn't so i'l have to check.

            Edit: i'll take a code snippet with me next time.

            Jean paul

              It is most likely a gd function yes, i tried to look it up and see if i could remember the exact funtion but i couldn't so i'l have to check.

              Ah, but if it is a GD function, then the colour is one obtained via [man]imagecolorallocate/man, or similiar functions that return a colour identifier usable by other GD functions.

                9 days later

                That's what i used to get it working. I thought it might be possible with direct input of an intreger and as a result less code. It seems it's not, thanx for clearing that up.

                  Write a Reply...