Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noties/iconview
One image resource for multiple colors
https://github.com/noties/iconview
Last synced: 2 months ago
JSON representation
One image resource for multiple colors
- Host: GitHub
- URL: https://github.com/noties/iconview
- Owner: noties
- License: apache-2.0
- Created: 2017-06-21T09:39:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-21T09:44:39.000Z (over 7 years ago)
- Last Synced: 2023-07-07T14:17:22.516Z (over 1 year ago)
- Language: Java
- Size: 98.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IconView
One image resource for multiple colors[![Maven Central](https://img.shields.io/maven-central/v/ru.noties/iconview.svg)](http://search.maven.org/#search|ga|1|g%3A%22ru.noties%22%20AND%20a%3A%22iconview%22)
Simple one-class library for applying different colors to one image resource.
![screenshot](art/screenshot.png)
```xml
```
```java
final IconView iconView = (IconView) findViewById(R.id.icon_view);
iconView.setColor(ContextCompat.getColor(this, R.color.colorAccent));
```Underneath it just uses `ProterDuffColorFilter` with `MULTIPLY` mode, so **solid white** image resources are a good fit. If you want to change porter duff mode add attribute to your layout definition via: `app:iv_mode="src_atop"` or Java: `iconView.setMode(PorterDuff.Mode.SRC_ATOP)`
## License
```
Copyright 2017 Dimitry Ivanov ([email protected])Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```