Skip to content

Commit 7b66542

Browse files
Material Engcopybara-github
authored andcommitted
Minor comment updates in Java library.
PiperOrigin-RevId: 545652652
1 parent 80b26d2 commit 7b66542

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

java/contrast/Contrast.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public final class Contrast {
5555
private static final double CONTRAST_RATIO_EPSILON = 0.04;
5656

5757
// Color spaces that measure luminance, such as Y in XYZ, L* in L*a*b*, or T in HCT, are known as
58-
// perceptual accurate color spaces.
58+
// perceptually accurate color spaces.
5959
//
6060
// To be displayed, they must gamut map to a "display space", one that has a defined limit on the
6161
// number of colors. Display spaces include sRGB, more commonly understood as RGB/HSL/HSV/HSB.
@@ -75,7 +75,7 @@ public final class Contrast {
7575
// result such that the desired contrast ratio will be reached even if inaccuracy is introduced.
7676
//
7777
// 0.4 is generous, ex. HCT requires much less delta. It was chosen because it provides a rough
78-
// guarantee that as long as a percetual color space gamut maps lightness such that the resulting
78+
// guarantee that as long as a perceptual color space gamut maps lightness such that the resulting
7979
// lightness rounds to the same as the requested, the desired contrast ratio will be reached.
8080
private static final double LUMINANCE_GAMUT_MAP_TOLERANCE = 0.4;
8181

java/hct/HctSolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ public static int solveToInt(double hueDegrees, double chroma, double lstar) {
661661
* @param hueDegrees The desired hue, in degrees.
662662
* @param chroma The desired chroma.
663663
* @param lstar The desired L*.
664-
* @return An CAM16 object representing the sRGB color. The color has sufficiently close hue,
664+
* @return A CAM16 object representing the sRGB color. The color has sufficiently close hue,
665665
* chroma, and L* to the desired values, if possible; otherwise, the hue and L* will be
666666
* sufficiently close, and chroma will be maximized.
667667
*/

java/quantize/PointProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@
1818

1919
/** An interface to allow use of different color spaces by quantizers. */
2020
public interface PointProvider {
21+
/** The four components in the color space of an sRGB color. */
2122
public double[] fromInt(int argb);
2223

24+
/** The ARGB (i.e. hex code) representation of this color. */
2325
public int toInt(double[] point);
2426

27+
/**
28+
* Squared distance between two colors. Distance is defined by scientific color spaces and
29+
* referred to as delta E.
30+
*/
2531
public double distance(double[] a, double[] b);
2632
}

java/scheme/Scheme.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,22 @@ public Scheme(
119119
this.inversePrimary = inversePrimary;
120120
}
121121

122+
/** Creates a light theme Scheme from a source color in ARGB, i.e. a hex code. */
122123
public static Scheme light(int argb) {
123124
return lightFromCorePalette(CorePalette.of(argb));
124125
}
125126

127+
/** Creates a dark theme Scheme from a source color in ARGB, i.e. a hex code. */
126128
public static Scheme dark(int argb) {
127129
return darkFromCorePalette(CorePalette.of(argb));
128130
}
129131

132+
/** Creates a light theme content-based Scheme from a source color in ARGB, i.e. a hex code. */
130133
public static Scheme lightContent(int argb) {
131134
return lightFromCorePalette(CorePalette.contentOf(argb));
132135
}
133136

137+
/** Creates a dark theme content-based Scheme from a source color in ARGB, i.e. a hex code. */
134138
public static Scheme darkContent(int argb) {
135139
return darkFromCorePalette(CorePalette.contentOf(argb));
136140
}

0 commit comments

Comments
 (0)