{"repo":"skydoves/Rainbow","free":true,"listed":false,"github":"https://github.com/skydoves/Rainbow","clone":"git clone https://github.com/skydoves/Rainbow.git","description":"🌈 An expressive Kotlin DSL for dynamically creating and applying gradients, text shaders, and tints to any Android View.","language":"Kotlin","stars":460,"topics":["kotlin","android","android-library","rainbow","gradient","gradation","tint","tinting","skydoves"],"license":"Apache-2.0","category":"mobile-apps","readme_excerpt":"Rainbow 🌈 An expressive Kotlin DSL for dynamically creating and applying gradients, text shaders, and tints to any Android View. Download Gradle Add the dependency below on your root build.gradle.kts file: Usage We can apply gradations and tinting to any views easily using Rainbow class. Palette A gradient is defined by a collection of colors, which we refer to as a palette . The palette lambda block is the primary mechanism for constructing this collection. Within the lambda, you can add colors using the contextColor and color functions. The contextColor function resolves a color resource from your colors.xml file, whereas the color function accepts a ColorInt value directly. These functions should be used with the unary + operator to add them to the palette. Here is kotlin extension ways to apply gradations using View.rainbow() method to views. Background, Foreground Once a palette is defined, you can apply the resulting gradient to a view's background or foreground . The gradient's orientation and corner radius can be customized. There are eight predefined orientations available in the RainbowOrientation enum. Shading TextViews For TextView instances, Rainbow provides a shade method that applies the gradient to the text itself, creating a multi-colored text effect. You can also define a palette from a color array resource declared in XML. Tinting Views The tint method applies the defined palette as a tint color. This is effective for views that support tinting, such as Im","default_branch":null,"files":null,"tree":[],"storefront":"/r/skydoves","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/skydoves/Rainbow/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}