Hello i have the imageview
The css i got from boss is :
/* Rectangle 3: */
background-image: linear-gradient(-180deg, rgba(137,129,129,0.00) 0%, rgba(0,0,0,0.51) 100%);
I search many websites but it's seem impossible.
I read that post Drawing gradient over image in ios then i think is that a solution to apply that css to my image. Or convert this css to objective C code.
Does someone meet same problem?
For this case, you can use gradient color as you already told. The trick is, put gradient color to a view and place that view over image view, and than set its opacity (alpha) to 0.51f.
You check here for a CAGradientLayer example and another option is using a great color library Chameleon for creating gradient color and layer.
Related
Currently busy on creating a range input. However, the range input should be a different background-color, depending where the thumb is.
So far it is working fine, but the thumb is barely visible. Is there some way I can get the thumb on top of the slider? Tried all sorts of styling; position, z-index, display etc.
Here is a snippet of what I have so far.
My expected behavior would be a white circle as thumb, around 20x20.
Use gradient background on the track
You could style the track in such a way that you achieve the same result, using a gradient as background. For a slider at 20% it would be something like:
background: linear-gradient(to right, blue 20%, purple 20%);
A full working example can be found here: https://jsfiddle.net/jkrielaars/frdyr15L/7/
Add styles to CSS
Unfortunately, we can not access the track style directly from js. A workaround for this problem is to add all the possible values in CSS, and than activate them by changing the class, or an other attribute on the input element. (I use style in my example)
This can easily done using some SASS magic.
For a range input from 0 to 100 it could look like this:
#for $i from 0 through 100 {
input[type=range][style=v#{$i}]::-webkit-slider-runnable-track {
background: linear-gradient(to right, blue round(percentage($i/100)), purple round(percentage($i/100)));
}
}
(Note that you can't just use a numeral value in the style attribute. I've adde a letter to make it a string.)
Update element using javascript
Updating the style attribute can be done with some simple javascript. Using the oninput attribute you can make the style update as you slide around.
<input type="range" style="v20" value="20" oninput="this.setAttribute('style', 's'+this.value);"></input>
I came across this tool that will be practical using the first top box (deg)
http://www.workwithcolor.com/hsl-color-picker-01.htm
I have this css code:
#FullMenuContent input:checked { -webkit-filter: hue-rotate(290deg);
filter: hue-rotate(290deg);
That produces a color, fine. I understood that the image must have a color (does not work on grey scale). I understood that the final result depends on the color of the image, so my question is:
What should be the color of the image for the color picker linked above to be accurate?
Hi i was going through a website where they used a very unique (according to me) background. they are mixing a color with an image and using it as background. the image is like
Then they are mixing some yellow color in it & it become like this
When i went through the code they were using something like this
background: #f6b93c url(bg1.png);
but it did not work for me!
Please help me out?
That is nothing but a short hand syntax
background: #f6b93c url(bg1.png);
So the above code simply means
background-color: #f6b93c;
background-image: url(bg1.png);
For more info on background short hand syntax
Demo
a png image with transparency and bg color will do the trick,
Otherwise if it is a jpeg,
the color will fill the rest of the part(for eg:in a div), the image wont cover.
what was happening with this background: #f6b93c url(bg1.png);
fill the color #f6b93c then on the top of that place the image, so it was a %0%(for eg.) transparent image, this will end up with a mixer of both
with latest CSS3 technology, it is possible to create texured background. Check this out: http://lea.verou.me/css3patterns/#
but it still limited on so many aspect. And browser support is also not so ready.
your best bet is using small texture image and make repeat to that background. you could get some nice ready to use texture image here:
http://subtlepatterns.com
The image bg1.png does not seem to be in baseurl. You should try relative url. eg. if you have image inside 'images' folder, "images/bg1.png" should work.
I want to have a transparent background-color and I use gradient filter as a fallback of RGBA in IE. The code is like this:
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#bfffffff,endColorstr=#bfffffff);
I also want to trigger an event when the user clicks the background, but it seems like the click event doesn't get triggered after I set the filter. Everything is ok without the filter.
So is it another IE bug? How can I solve the problem?
This is probably related to the IE bug that makes links with transparent background no longer clickable: I came across it today. I had a link with a transparent background and display set to block: the main area of the link wasn't clickable, but a 10px border I set on it was. It seems IE also has problems with filters.
This kind of bug is discussed here and here. The first guy's solution is to give a fake background image to the element before setting the filter. The second guy's is to give the element a background colour and set the opacity to 1%, which will make it practically invisible in IE. Hopefully you'll be able to get round it using one of these.
This is not the deal.
Internet explorer creates the filters on a separate layer which is placed above your element and since the new graphic layer is not part of the element - which you have the click event on - there will be no event bubbling.
Recently I made a label element with a nice gradient filter for IE. Only the text can be clicked. If I analyze the label layers from the side with and without the gradient layer, then you will understand the problem.
without gradient filter:
------------------
text layer
------------------
background layer
------------------
with gradient filter:
------------------
text layer
------------------
gradient layer
------------------
background layer
------------------
By the way, that is the reason, why you cannot put a border radius on a gradient filter too. Try it. Create an element, and style it with border radius and give it a gradient filter and run it in IE 9. No matter how you try to force the gradient to stay inside the round borders - with for example overflow:hidden -, it will never obey. Its like a separate element which is positioned absolute and right above your element to cover it up and right under the text.
I need my visual content to become darker (like when modal Alert is shown). I've tried to look up in the source code of Alert and PopUpManager, but found only blur and fade effects there... Is there any basic Filter to do set content darker? Thanks
You can use ColorTransform with color multipliers:
component.transform.colorTransform = new ColorTransform(0.5, 0.5, 0.5);
There are 4 styles you can set on the global identifier in styles to set all modal popup background effects. I think you'll want something like this:
global
{
modal-transparency-blur:0; /* no blur */
modal-transparency:0.5;
modal-transparency-color:#000000;
modal-transparency-duration:0; /* no animation, goes straight to faded black. in ms */
}
What about creating a new UIComponent/Sprite whatever you use, making it black with opacity liek 50% and pushing on top of the display list just below stuff you want to show.