Skip to content

Instantly share code, notes, and snippets.

uploadArchives {
repositories {
// mavenLocal config
mavenDeployer {
repository(url: mavenLocal().url)
pom.groupId = rootProject.group
pom.artifactId = project.name
pom.version = rootProject.version
}
if (publishToNexus) {
@Pinned
Pinned / ColorUtils.java
Created May 14, 2019 03:05
颜色转换,变暗效果。可用于按钮点击效果。 Convert the color, return the new color that dark than before. this can be used for btn click preview.
public static int manipulateColor(int color, float rFactor, float gFactor, float bFactor) {
int a = Color.alpha(color);
int r = Math.round(Color.red(color) * rFactor);
int g = Math.round(Color.green(color) * gFactor);
int b = Math.round(Color.blue(color) * bFactor);
return Color.argb(a,
Math.min(r, 255),
Math.min(g, 255),
Math.min(b, 255));
}