Changing the particular color in an image - iphone

By using the following image i want to write code.
here is the image i want to do this one programmatically.
User can select roof or wall or fencing or windows. After selecting the particular part and color(another model) then the present color(another model) should replace with selected color.
In this image(example) user selected color(yellow) for wall and brown color for roof, after selection of color and part, old color should replace with new one.
How can we achieve this
any suggestions or help

Check my answer of how you can change the specific colors of UIImage.
Two notes:
the question is about gray to white color change, you can use this technique to change any color to any other,
the code is taken from somewhere of the developers reference, so that colors in the snippet are kinda random.

Related

I would like to know how to get the color code of a certain point

・Purpose
I want to change the color of the padding to match the color of a particular point in the app.
Because I want to make the statesbar change color.
・What I want
Color code for a specific point
If I scroll down and come to the blue part of the image at a specific point, I want to get the blue color code.
===
I have done quite a bit of research and have found no information on how to do that.
Therefore, I would like to know.
The screen in the screenshot is a webView.
I would like to be able to get the color code for a specific point so I can change the color on the webView screen and on the widget.

How to know the background color of Pdf

Sometimes pdf might have a transparent background. And In my application I have given a option to choose background. So, in case of pdf with transparent background and background color black all things becomes black black so, any way to check or any key inside dictionary of pdf page that can help me? Any help will appreciated.
The easiest solution for you would be to remove black color from available background colors.
Generally, all pdf pages have transparent background and the white background color is set by the viewer application. It is possible to set a background color for each page. You can read all about it in Page Group under Transparency section of the PDF Reference.
It is also possible to show a background color for a page by setting 'BoxColorInfo' dictionary in the page dictionary with appropriate values.
But I am not sure what you can achieve by knowing what color a page background is, since black background is going to be a problem for PDFs with transparent pages anyways.
EDIT: Following is the paragraph from PDFReference i was trying to point you to:
Ordinarily, the page is imposed directly on an output medium, such as
paper or a display screen. The page group is treated as an isolated
group, whose results are then composited with a backdrop color
appropriate for the medium. The backdrop is nominally white, although
varying according to the actual properties of the medium. However,
some applications may choose to provide a different backdrop, such as
a checkerboard or grid to aid in visualizing the effects of
transparency in the artwork.
It says that most PDFs would have a transparent and it is your application which shows the background color. Hope this helps.

I want to build a UIView which helps the user to choose a color from a pattern

Hi,
I want to add this image and make the user choose a color from the image, can it be done wisely, is there any open source project which does that?
Thanks
While getting the color of a pixel at a particular point is easy (and answers to that are there in the first comment on the question), I just wanted to offer that a user might expect a magnifying glass or some UI that helps them pick the color - people aren't going to be able to tap exactly on the color they want on the iPhone since the color wheel is likely to be rather small.

how to draw a popover view instead of using image on iPhone?

just like the popover in the attached screenshots, the popover allow user to change themes.
I know that there are some examples around but they are all using images to achieve this, make it hard to change themes.
I believe the app in the screenshots doesn't using images to do it.
thanks for any help!
In my Win background such skins (called "Flat" in Delphi and WinForms) were made by drawing in code: select a color, draw a line, select another color, draw a rounded rectangle and so on.
Also, it is necessary to introduce a class "ColorTheme" with a set of fields for every color used. You may have several ColorTheme instances and swap them when you need to change color theme.

how to display color palette in iPhone

In my iPhone app, I want to allow the user to draw image by hand with different colors.
I want the color palette where user can select the color and draw with the selected color.
How can I show the color palette in iPhone?
You can create a view with several buttons on it. Buttons should have background color also give them different tags (according to color). Now when you press on the button get its tag and then you can get the color from an array (you need to first create an array with color codes or RGB). when you can color code or RGB you can draw with that color.
Post comment if you have confusion
You'll have to do this yourself as there is no system color picker. If you don't want to create one from scratch, you might want to look for some existing free project as a code base.
Take a look at this open source project, for a start. It's under the BSD license.