You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IndexedColors.java 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.ss.usermodel;
  16. /**
  17. * A deprecated indexing scheme for colours that is still required for some records, and for backwards
  18. * compatibility with OLE2 formats.
  19. *
  20. * <p>
  21. * Each element corresponds to a color index (zero-based). When using the default indexed color palette,
  22. * the values are not written out, but instead are implied. When the color palette has been modified from default,
  23. * then the entire color palette is used.
  24. * </p>
  25. *
  26. * @author Yegor Kozlov
  27. */
  28. public enum IndexedColors {
  29. BLACK(8),
  30. WHITE(9),
  31. RED(10),
  32. BRIGHT_GREEN(11),
  33. BLUE(12),
  34. YELLOW(13),
  35. PINK(14),
  36. TURQUOISE(15),
  37. DARK_RED(16),
  38. GREEN(17),
  39. DARK_BLUE(18),
  40. DARK_YELLOW(19),
  41. VIOLET(20),
  42. TEAL(21),
  43. GREY_25_PERCENT(22),
  44. GREY_50_PERCENT(23),
  45. CORNFLOWER_BLUE(24),
  46. MAROON(25),
  47. LEMON_CHIFFON(26),
  48. ORCHID(28),
  49. CORAL(29),
  50. ROYAL_BLUE(30),
  51. LIGHT_CORNFLOWER_BLUE(31),
  52. SKY_BLUE(40),
  53. LIGHT_TURQUOISE(41),
  54. LIGHT_GREEN(42),
  55. LIGHT_YELLOW(43),
  56. PALE_BLUE(44),
  57. ROSE(45),
  58. LAVENDER(46),
  59. TAN(47),
  60. LIGHT_BLUE(48),
  61. AQUA(49),
  62. LIME(50),
  63. GOLD(51),
  64. LIGHT_ORANGE(52),
  65. ORANGE(53),
  66. BLUE_GREY(54),
  67. GREY_40_PERCENT(55),
  68. DARK_TEAL(56),
  69. SEA_GREEN(57),
  70. DARK_GREEN(58),
  71. OLIVE_GREEN(59),
  72. BROWN(60),
  73. PLUM(61),
  74. INDIGO(62),
  75. GREY_80_PERCENT(63),
  76. AUTOMATIC(64);
  77. private int index;
  78. IndexedColors(int idx){
  79. index = idx;
  80. }
  81. /**
  82. * Returns index of this color
  83. *
  84. * @return index of this color
  85. */
  86. public short getIndex(){
  87. return (short)index;
  88. }
  89. }