193 lines
5 KiB
Smali
193 lines
5 KiB
Smali
.class public final Lcom/discord/utilities/quantize/Palette$Swatch;
|
|
.super Ljava/lang/Object;
|
|
.source "Palette.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/quantize/Palette;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Swatch"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final mBlue:I
|
|
|
|
.field public final mGreen:I
|
|
|
|
.field public mHsl:[F
|
|
|
|
.field public final mPopulation:I
|
|
|
|
.field public final mRed:I
|
|
|
|
.field public final mRgb:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(II)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
invoke-static {p1}, Landroid/graphics/Color;->red(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mRed:I
|
|
|
|
invoke-static {p1}, Landroid/graphics/Color;->green(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mGreen:I
|
|
|
|
invoke-static {p1}, Landroid/graphics/Color;->blue(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mBlue:I
|
|
|
|
iput p1, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mRgb:I
|
|
|
|
iput p2, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mPopulation:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(IIII)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput p1, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mRed:I
|
|
|
|
iput p2, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mGreen:I
|
|
|
|
iput p3, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mBlue:I
|
|
|
|
invoke-static {p1, p2, p3}, Landroid/graphics/Color;->rgb(III)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mRgb:I
|
|
|
|
iput p4, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mPopulation:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getHsl()[F
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mHsl:[F
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x3
|
|
|
|
new-array v0, v0, [F
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mHsl:[F
|
|
|
|
iget v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mRed:I
|
|
|
|
iget v1, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mGreen:I
|
|
|
|
iget v2, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mBlue:I
|
|
|
|
iget-object v3, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mHsl:[F
|
|
|
|
invoke-static {v0, v1, v2, v3}, Lcom/discord/utilities/quantize/ColorUtils;->RGBtoHSL(III[F)V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mHsl:[F
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getPopulation()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mPopulation:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getRgb()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mRgb:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
.locals 3
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-class v1, Lcom/discord/utilities/quantize/Palette$Swatch;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v1, " "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "["
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/quantize/Palette$Swatch;->getRgb()I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const/16 v1, 0x5d
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "[HSL: "
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/quantize/Palette$Swatch;->getHsl()[F
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2}, Ljava/util/Arrays;->toString([F)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "[Population: "
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v2, p0, Lcom/discord/utilities/quantize/Palette$Swatch;->mPopulation:I
|
|
|
|
invoke-static {v0, v2, v1}, Lf/e/b/a/a;->a(Ljava/lang/StringBuilder;IC)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|