Skip to content

Commit a7a7b75

Browse files
committed
docs: other classes
1 parent 079a937 commit a7a7b75

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

palette/src/main/java/com/catppuccin/Color.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,56 @@
11
package com.catppuccin;
22

3+
/**
4+
* This class provides utility methods to provide different representations of the RGB color data.
5+
*/
36
public class Color {
47
private final int r;
58
private final int g;
69
private final int b;
710

11+
/**
12+
* Generate a Color based on the provided RGB values
13+
* @param r the red value
14+
* @param b the green value
15+
* @param g the blue value
16+
*/
817
public Color(int r, int b, int g) {
918
this.r = r;
1019
this.g = g;
1120
this.b = b;
1221
}
1322

23+
/**
24+
* @return the red component
25+
*/
1426
public int r() {
1527
return this.r;
1628
}
1729

30+
/**
31+
* @return the green component
32+
*/
1833
public int g() {
1934
return this.g;
2035
}
2136

37+
/**
38+
* @return the blue component
39+
*/
2240
public int b() {
2341
return this.b;
2442
}
2543

44+
/**
45+
* @return the color, as a hex string
46+
*/
2647
public String hex() {
2748
return String.format("%02x%02x%02x", this.r(), this.g(), this.b());
2849
}
2950

51+
/**
52+
* @return the components of the color as a 3 element array
53+
*/
3054
public int[] components() {
3155
return new int[]{
3256
r(),

palette/src/main/java/com/catppuccin/Palette.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,30 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
/**
7+
* This class represents the entirety of the Catppuccin v0.2.0 palette.
8+
*/
69
@GeneratedPalette(target="com.catppuccin.BuiltinPalettes")
710
public class Palette
811
{
12+
/**
13+
* Mocha flavoured Catppuccin
14+
*/
915
public static final Flavor MOCHA = com.catppuccin.BuiltinPalettes.MOCHA;
16+
17+
/**
18+
* Macchiato flavoured Catppuccin
19+
*/
1020
public static final Flavor MACCHIATO = com.catppuccin.BuiltinPalettes.MACCHIATO;
21+
22+
/**
23+
* Frappe flavoured Catppuccin
24+
*/
1125
public static final Flavor FRAPPE = com.catppuccin.BuiltinPalettes.FRAPPE;
26+
27+
/**
28+
* Latte flavoured Catppuccin
29+
*/
1230
public static final Flavor LATTE = com.catppuccin.BuiltinPalettes.LATTE;
1331

1432
public List<Flavor> toList() {

0 commit comments

Comments
 (0)