Re: Scintilla Colours
| From: | Alan Knowles | Date: | Thu, 30 Jan 2003 03:32:22 +0000 |
| Subject: | Re: Scintilla Colours | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2988@lists.php.net to get a copy of this message | ||
Aaron Bishell wrote:
Using methods such as "set_sel_fore" on a scintilla widget demands that the second argument be an integer representing the colour. I went to the scintilla homepage here: http://www.scintilla.org/ScintillaDoc.html#colour And it says: Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour is set in the range 0 to 255. If you have three such intensities, they are combined as: red | (green << 8) | (blue << 16). I know the << operator is a binary shift operator but I don't know exactly how it works in terms of decimal numbers. Basically id like an example of how to convert three RGB numbers (e.g. R:10, G:36, B:106) to this integer equivalent. I had a look through PHPmole and all the settings are in the integer form so not much help. Any help appreciated. http://docs.akbkhome.com/phpmole/phpmole_config_dialog.html#colorsel_okif you look at it, get_color() comes from the gtk colour widget which returns hex rgb, the bit that sets $b reverses it to bgr, and turns it into a hex string. (which is turned back into an integer on the next line..) I'm not evens sure if that description is correct - It took a long while to work out this :) Regards Alan
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com