tint

jQuery: there is a way to apply colour (tint) to an image?

有些话、适合烂在心里 提交于 2019-11-27 02:09:25
there is a way to colour (apply tint) an image using jQ or some plugs? thank you Daniel Ruf As already mentioned in Dynamically changing image colours take a look at Pixastic (coloradjust) https://github.com/jseidelin/pixastic http://www.pixastic.com/lib/docs/actions/coloradjust/ or PaintbrushJS (colour tint) https://github.com/mezzoblue/PaintbrushJS http://mezzoblue.github.com/PaintbrushJS/demo/ Simplest way I can think of is overlaying a semitransparent div over the image. A little example: HTML <div id="overlay" class="overlay"></div> <img id="myimg" src="img.jpg" /> CSS .overlay { display:

MenuItem tinting on AppCompat Toolbar

穿精又带淫゛_ 提交于 2019-11-26 23:48:27
When I use drawables from the AppCompat library for my Toolbar menu items the tinting works as expected. Like this: <item android:id="@+id/action_clear" android:icon="@drawable/abc_ic_clear_mtrl_alpha" <-- from AppCompat android:title="@string/clear" /> But if I use my own drawables or actually even copy the drawables from the AppCompat library to my own project it will not tint at all. <item android:id="@+id/action_clear" android:icon="@drawable/abc_ic_clear_mtrl_alpha_copy" <-- copy from AppCompat android:title="@string/clear" /> Is there some special magic in the AppCompat Toolbar that only

Tinting Image in Java improvement

荒凉一梦 提交于 2019-11-26 23:25:27
问题 I looked for an easy way to tint an image in Java but I found nothing that suited my needs. I went to the following solution: First create a new Image that serves as a copy of the Image I want to tint, then I create a second Image that is a transparent mask of the Image I want to tint and then draw the tint - mask over my copy and return the copy: public static BufferedImage tintImage(Image original, int r, int g, int b){ int width = original.getWidth(null); int height = original.getHeight

How can I tint a UIImage with gradient?

和自甴很熟 提交于 2019-11-26 19:09:13
问题 I searched everywhere but didn't find the solution. I have image 1. How can I programatically tint them with gradient to get images 2 and 3? Here are those images: Tints that I applied to them via Photoshop are simple 2-color linear gradients. And my question is: how can I achieve this effect programatically? Solution: jrtc27 gave me almost working example. I fixed it (for ARC) and made it reusable (using UIImage's category). Here is it: - (UIImage *)tintedWithLinearGradientColors:(NSArray *

How would I tint an image programmatically on iOS?

时光总嘲笑我的痴心妄想 提交于 2019-11-26 12:40:34
I would like to tint an image with a color reference. The results should look like the Multiply blending mode in Photoshop, where whites would be replaced with tint : I will be changing the color value continuously. Follow up: I would put the code to do this in my ImageView's drawRect: method, right? As always, a code snippet would greatly aid in my understanding, as opposed to a link. Update: Subclassing a UIImageView with the code Ramin suggested. I put this in viewDidLoad: of my view controller: [self.lena setImage:[UIImage imageNamed:kImageName]]; [self.lena setOverlayColor:[UIColor

Android: Tint using DrawableCompat

时光怂恿深爱的人放手 提交于 2019-11-26 11:59:25
问题 I\'m trying to tint an image prior to Android API level 21. I\'ve successfully tinted items using: <android:tint=\"@color/red\"/> However, I can\'t seem to figure out how to do this through code on an ImageView: Drawable iconDrawable = this.mContext.getResources().getDrawable(R.drawable.somedrawable); DrawableCompat.setTint(iconDrawable, this.mContext.getResources().getColor(R.color.red)); imageView.setImageDrawable(iconDrawable); I\'ve tried setting the TintMode but this seems to make no

How to set tint for an image view programmatically in android?

对着背影说爱祢 提交于 2019-11-26 11:30:46
Need to set tint for an image view... I am using it the following way: imageView.setColorFilter(R.color.blue,android.graphics.PorterDuff.Mode.MULTIPLY); But it doesn't change... Hardik You can change the tint, quite easily in code via: imageView.setColorFilter(Color.argb(255, 255, 255, 255)); // White Tint If you want color tint then imageView.setColorFilter(ContextCompat.getColor(context, R.color.COLOR_YOUR_COLOR), android.graphics.PorterDuff.Mode.MULTIPLY); For Vector Drawable imageView.setColorFilter(ContextCompat.getColor(context, R.color.COLOR_YOUR_COLOR), android.graphics.PorterDuff.Mode

How to tint a transparent PNG image in iPhone?

↘锁芯ラ 提交于 2019-11-26 10:05:32
问题 I know it\'s possible to tint a rectangular image by drawing a CGContextFillRect over it and setting the blend mode. However, I can\'t figure out how to do a tint on a transparent image such as an icon. It must be possible since the SDK does it itself on tab-bars in such. Would anyone be able to provide a snippet? UPDATE: Lots of great suggestions have been given for this problem since I originally asked. Be sure to read through all the answers to figure out what suits you best. UPDATE (Apr

jQuery: there is a way to apply colour (tint) to an image?

旧时模样 提交于 2019-11-26 09:59:16
问题 there is a way to colour (apply tint) an image using jQ or some plugs? thank you 回答1: As already mentioned in Dynamically changing image colours take a look at Pixastic (coloradjust) https://github.com/jseidelin/pixastic http://www.pixastic.com/lib/docs/actions/coloradjust/ or PaintbrushJS (colour tint) https://github.com/mezzoblue/PaintbrushJS http://mezzoblue.github.com/PaintbrushJS/demo/ 回答2: Simplest way I can think of is overlaying a semitransparent div over the image. A little example:

MenuItem tinting on AppCompat Toolbar

旧城冷巷雨未停 提交于 2019-11-26 09:16:03
问题 When I use drawables from the AppCompat library for my Toolbar menu items the tinting works as expected. Like this: <item android:id=\"@+id/action_clear\" android:icon=\"@drawable/abc_ic_clear_mtrl_alpha\" <-- from AppCompat android:title=\"@string/clear\" /> But if I use my own drawables or actually even copy the drawables from the AppCompat library to my own project it will not tint at all. <item android:id=\"@+id/action_clear\" android:icon=\"@drawable/abc_ic_clear_mtrl_alpha_copy\" <--