I have to access 3 values of color which are found in my theme's presently active skin folder. In every of my theme's "skin" folder's I've 3 images: header.presen, footer.presen and place.presen.
These images are the same size and therefore are used just for background colors during my theme skins. The theme owner can produce a custom color for all of their theme skins which are saved within the particular skin's folder.
Can someone assist me to using the code to get this done?
Generate an income view it, I'm able to either open the files themeselves then browse the RGB value and assign that to some variable I'm able to use, or I'm able to open a text file that contains the values (written simultaneously I recolor the pictures when theme choices are saved)
Basically make use of a text file, I'll keep values inside a file known as colors.txt like so...
This really is off the top my mind. Possibly an xml format may be better, I'll leave that as much as discussion. Its only a small data store.
At run time, I only desire to retrieve this file and grab the need for each color after which assign that to my colorpicker thumbnail to exhibit the present custom place colors for that user's selected skin for my theme.
These colors represent the colour of every of three images in every of my theme's skins folders (header.presen, sidebar.presen and place.presen). If it is simpler simply to open individuals files and browse the colour value then convert it to hex, I'd rather do this.
I really hope I have described rid of it enough :)
Your gifs really are a single uniform color each? Can't you utilize CSS for background colors for the reason that situation?
Offhand I'd say it might be much simpler to keep your color values as JSON or XML and browse it this way this can save your valuable script the overhead of opening a picture and becoming data any time you run it.
However, if you think the necessity to get colors from images, or you have to calculate the typical color within an image (or something like that) take a look in the GD image manipulation library, basically understand you properly you could utilize
imagecolorsforindex to obtain RGB values out of your images.