• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hee9841 / excel-module / #35

25 Apr 2025 09:05AM UTC coverage: 82.791%. First build
#35

Pull #58

github

hee9841
Revert "Chore: 배포를 위한 PR template 추가 (#54)"

This reverts commit bd34b2c5e.
Pull Request #58: Release 0.0.1

105 of 168 new or added lines in 16 files covered. (62.5%)

534 of 645 relevant lines covered (82.79%)

0.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/main/java/io/github/hee9841/excel/style/color/ColorPalette.java
1
package io.github.hee9841.excel.style.color;
2

3
import io.github.hee9841.excel.exception.ExcelStyleException;
4

5
/**
6
 * Enumeration of predefined colors for Excel cells, identified by indices.
7
 * This enum wraps the standard color palette available in Excel, providing
8
 * convenient access to common colors through their index values.
9
 *
10
 * <p>The colors are organized by index values (0-64) that correspond to Excel's
11
 * built-in color palette. This class enables the use of these colors without
12
 * having to remember their numeric index values.</p>
13
 */
14
public enum ColorPalette {
1✔
15
    BLACK1(0),
1✔
16
    WHITE1(1),
1✔
17
    RED1(2),
1✔
18
    BRIGHT_GREEN1(3),
1✔
19
    BLUE1(4),
1✔
20
    YELLOW1(5),
1✔
21
    PINK1(6),
1✔
22
    TURQUOISE1(7),
1✔
23
    BLACK(8),
1✔
24
    WHITE(9),
1✔
25
    RED(10),
1✔
26
    BRIGHT_GREEN(11),
1✔
27
    BLUE(12),
1✔
28
    YELLOW(13),
1✔
29
    PINK(14),
1✔
30
    TURQUOISE(15),
1✔
31
    DARK_RED(16),
1✔
32
    GREEN(17),
1✔
33
    DARK_BLUE(18),
1✔
34
    DARK_YELLOW(19),
1✔
35
    VIOLET(20),
1✔
36
    TEAL(21),
1✔
37
    GREY_25_PERCENT(22),
1✔
38
    GREY_50_PERCENT(23),
1✔
39
    CORNFLOWER_BLUE(24),
1✔
40
    MAROON(25),
1✔
41
    LEMON_CHIFFON(26),
1✔
42
    LIGHT_TURQUOISE1(27),
1✔
43
    ORCHID(28),
1✔
44
    CORAL(29),
1✔
45
    ROYAL_BLUE(30),
1✔
46
    LIGHT_CORNFLOWER_BLUE(31),
1✔
47
    SKY_BLUE(40),
1✔
48
    LIGHT_TURQUOISE(41),
1✔
49
    LIGHT_GREEN(42),
1✔
50
    LIGHT_YELLOW(43),
1✔
51
    PALE_BLUE(44),
1✔
52
    ROSE(45),
1✔
53
    LAVENDER(46),
1✔
54
    TAN(47),
1✔
55
    LIGHT_BLUE(48),
1✔
56
    AQUA(49),
1✔
57
    LIME(50),
1✔
58
    GOLD(51),
1✔
59
    LIGHT_ORANGE(52),
1✔
60
    ORANGE(53),
1✔
61
    BLUE_GREY(54),
1✔
62
    GREY_40_PERCENT(55),
1✔
63
    DARK_TEAL(56),
1✔
64
    SEA_GREEN(57),
1✔
65
    DARK_GREEN(58),
1✔
66
    OLIVE_GREEN(59),
1✔
67
    BROWN(60),
1✔
68
    PLUM(61),
1✔
69
    INDIGO(62),
1✔
70
    GREY_80_PERCENT(63),
1✔
71
    AUTOMATIC(64);
1✔
72

73
    private static final ColorPalette[] _values = new ColorPalette[65];
1✔
74
    private final short index;
75

76
    ColorPalette(int idx) {
1✔
77
        this.index = (short) idx;
1✔
78
    }
1✔
79

80
    /**
81
     * Returns the index value of this color.
82
     *
83
     * @return the index of this color
84
     */
85
    public short getIndex() {
86
        return this.index;
1✔
87
    }
88

89
    /**
90
     * Retrieves an IndexedColors enum constant by its index value.
91
     *
92
     * @param index the index value to look up
93
     * @return the IndexedColors constant corresponding to the given index
94
     * @throws ExcelStyleException if the index is invalid or not mapped to a color
95
     */
96
    public static ColorPalette fromInt(int index) {
97
        if (index >= 0 && index < _values.length) {
×
NEW
98
            ColorPalette color = _values[index];
×
99
            if (color == null) {
×
100
                throw new ExcelStyleException("Illegal IndexedColor index: " + index);
×
101
            } else {
102
                return color;
×
103
            }
104
        } else {
105
            throw new ExcelStyleException("Illegal IndexedColor index: " + index);
×
106
        }
107
    }
108

109
    static {
110
        for (ColorPalette color : values()) {
1✔
111
            _values[color.index] = color;
1✔
112
        }
113
    }
1✔
114
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc