// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
// 
//     /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
//     public static int applyColorAlpha(int color, float alpha) {
//         final int originalAlpha = Color.alpha(color);
//         // Return the color, multiplying the original alpha by the disabled value
//         return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
//     }
// 
//     /** Override the colors alpha and set it to the given value [0..255]. */
//     public static int replaceColorAlpha(int color, int alpha) {
//         return (color & 0x00ffffff) | (alpha << 24);
//     }
// 
//     /** Calculate the resulting alpha from the original color and the relative alpha. */
//     public static int calculateAlpha(int alpha, int originalColor) {
//         int originalAlpha = Color.alpha(originalColor);
//         return originalAlpha * alpha / 255;
//     }
// 
// 
// }


import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils;
        // Bottom right corner (clockwise)
        RectF bottomRightArc = new RectF(
                right - cornerSize,
                bottom - cornerSize,
                right,
                bottom
        );
        result.arcTo(bottomRightArc, 0, 90);

        // Bottom left corner (clockwise)
        RectF bottomLeftArc = new RectF(
                left,
                bottom - cornerSize,
                left + cornerSize,
                bottom
        );
        result.arcTo(bottomLeftArc, 90, 90);

        result.close();
        return result;
    }

    @Override
    public int getOpacity() {
        return PixelFormat.TRANSLUCENT;
    }

    @Override
    public void setAlpha(int alpha) {
        if (mBorderPaint != null) {
// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
// 
//     /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
//     public static int applyColorAlpha(int color, float alpha) {
//         final int originalAlpha = Color.alpha(color);
//         // Return the color, multiplying the original alpha by the disabled value
//         return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
//     }
// 
//     /** Override the colors alpha and set it to the given value [0..255]. */
//     public static int replaceColorAlpha(int color, int alpha) {
//         return (color & 0x00ffffff) | (alpha << 24);
//     }
// 
//     /** Calculate the resulting alpha from the original color and the relative alpha. */
//     public static int calculateAlpha(int alpha, int originalColor) {
//         int originalAlpha = Color.alpha(originalColor);
//         return originalAlpha * alpha / 255;
//     }
// 
// 
// }


// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/RoundRectDrawable.java
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils;

        // Bottom right corner (clockwise)
        RectF bottomRightArc = new RectF(
                right - cornerSize,
                bottom - cornerSize,
                right,
                bottom
        );
        result.arcTo(bottomRightArc, 0, 90);

        // Bottom left corner (clockwise)
        RectF bottomLeftArc = new RectF(
                left,
                bottom - cornerSize,
                left + cornerSize,
                bottom
        );
        result.arcTo(bottomLeftArc, 90, 90);

        result.close();
        return result;
    }

    @Override
    public int getOpacity() {
        return PixelFormat.TRANSLUCENT;
    }

    @Override
    public void setAlpha(int alpha) {
        if (mBorderPaint != null) {
            int borderAlpha = ColorUtils.calculateAlpha(alpha, mState.mBorderColor);