Skip to content

Commit d8ace59

Browse files
committed
comments updated.
1 parent ac06cd3 commit d8ace59

File tree

4 files changed

+16
-26
lines changed

4 files changed

+16
-26
lines changed

library/src/main/java/io/syslogic/colorpicker/AlphaPatternDrawable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class AlphaPatternDrawable extends Drawable {
3131

3232
AlphaPatternDrawable(int rectangleSize) {
3333
this.mRectangleSize = rectangleSize;
34-
this.mPaintWhite.setColor(0xffffffff);
35-
this.mPaintGray.setColor(0xffcbcbcb);
34+
this.mPaintWhite.setColor(0xFFFFFFFF);
35+
this.mPaintGray.setColor(0xFFCBCBCB);
3636
}
3737

3838
@Override

library/src/main/java/io/syslogic/colorpicker/ColorPickerPanelView.java

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,28 @@ public class ColorPickerPanelView extends View {
2323
private int mColor = 0xFF000000;
2424

2525
/** the width in pixels of the border surrounding the color panel. */
26-
private float BORDER_WIDTH_PX;
26+
private final float BORDER_WIDTH_PX;
2727

28-
private float mDensity = 1f;
29-
30-
private Paint mBorderPaint;
31-
private Paint mColorPaint;
28+
private final Paint mBorderPaint;
29+
private final Paint mColorPaint;
3230

3331
private RectF mDrawingRect;
3432
private RectF mColorRect;
3533

3634
private AlphaPatternDrawable mAlphaPattern;
3735

36+
private final float mDensity;
37+
3838
public ColorPickerPanelView(@NonNull Context context, @NonNull AttributeSet attrs) {
3939
this(context, attrs, 0);
4040
}
4141

4242
public ColorPickerPanelView(@NonNull Context context, @NonNull AttributeSet attrs, int defStyle) {
4343
super(context, attrs, defStyle);
44-
init(context);
45-
}
46-
47-
private void init(@NonNull Context context) {
48-
this.mDensity = getDisplayDensity(context);
4944
BORDER_WIDTH_PX = getDimension(context, R.dimen.border_width_px);
50-
this.initPaintTools();
51-
}
52-
53-
private void initPaintTools() {
54-
mBorderPaint = new Paint();
55-
mColorPaint = new Paint();
45+
this.mDensity = getDisplayDensity(context);
46+
this.mBorderPaint = new Paint();
47+
this.mColorPaint = new Paint();
5648
}
5749

5850
private static float getDimension(@NonNull Context context, @DimenRes int resId) {
@@ -111,7 +103,6 @@ private void setUpColorRect() {
111103

112104
/**
113105
* Set the color that should be shown by this view.
114-
*
115106
* @param color the color value to set.
116107
*/
117108
public void setColor(int color) {
@@ -121,7 +112,6 @@ public void setColor(int color) {
121112

122113
/**
123114
* Get the color currently shown by this view.
124-
*
125115
* @return the current color value.
126116
*/
127117
public int getColor() {
@@ -130,7 +120,6 @@ public int getColor() {
130120

131121
/**
132122
* Set the color of the border surrounding the panel.
133-
*
134123
* @param color the color value to set.
135124
*/
136125
@SuppressWarnings("unused")
@@ -141,7 +130,6 @@ public void setBorderColor(int color) {
141130

142131
/**
143132
* Get the color of the border surrounding the panel.
144-
*
145133
* @return the current border color value.
146134
*/
147135
@SuppressWarnings("unused")

library/src/main/java/io/syslogic/colorpicker/ColorPickerPreference.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ public void setHexValueEnabled(boolean value) {
170170
}
171171

172172
/**
173+
* String.format("#%1$02X", color)
174+
*
173175
* @param color the color value to convert.
174176
*/
175177
@NonNull

library/src/main/java/io/syslogic/colorpicker/compose/ColorPickerComponent.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,10 @@ fun getHSV(value: Color): FloatArray {
470470

471471
/**
472472
* Convert H/S/V to Int.
473-
* @param alpha the color to convert.
474-
* @param hue the color to convert.
475-
* @param sat the color to convert.
476-
* @param value the color to convert.
473+
* @param alpha the alpha of the color.
474+
* @param hue the hue of the color.
475+
* @param sat the saturation of the color.
476+
* @param value the value of the color.
477477
* @return integer color value.
478478
*/
479479
fun toIntColor(alpha: Float, hue: Float, sat: Float, value: Float): Int {

0 commit comments

Comments
 (0)