(メッセージはありません)
@@ -36,7 +36,7 @@ | ||
36 | 36 | /** |
37 | 37 | * The 'black' RGB color. |
38 | 38 | */ |
39 | - public static final ColorValue BLACK = new GrayColorValue(0); | |
39 | + public static final ColorValue BLACK = fromGrayValue(0); | |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * The 'blue' RGB color. |
@@ -56,7 +56,7 @@ | ||
56 | 56 | /** |
57 | 57 | * The 'gray' RGB color. |
58 | 58 | */ |
59 | - public static final ColorValue GRAY = new GrayColorValue(0.5f); | |
59 | + public static final ColorValue GRAY = fromGrayValue(0.5f); | |
60 | 60 | |
61 | 61 | /** |
62 | 62 | * The 'lime' RGB color. |
@@ -91,7 +91,7 @@ | ||
91 | 91 | /** |
92 | 92 | * The 'silver' RGB color. |
93 | 93 | */ |
94 | - public static final ColorValue SILVER = new GrayColorValue(192f / 255f); | |
94 | + public static final ColorValue SILVER = fromGrayValue(192f / 255f); | |
95 | 95 | |
96 | 96 | /** |
97 | 97 | * The 'teal' RGB color. |
@@ -101,7 +101,7 @@ | ||
101 | 101 | /** |
102 | 102 | * The 'white' RGB color. |
103 | 103 | */ |
104 | - public static final ColorValue WHITE = new GrayColorValue(255f); | |
104 | + public static final ColorValue WHITE = fromGrayValue(255f); | |
105 | 105 | |
106 | 106 | /** |
107 | 107 | * The 'yellow' RGB color. |
@@ -217,7 +217,7 @@ | ||
217 | 217 | /** |
218 | 218 | * The 'darkgray' RGB color. |
219 | 219 | */ |
220 | - public static final ColorValue DARKGRAY = new GrayColorValue(169f / 255f); | |
220 | + public static final ColorValue DARKGRAY = fromGrayValue(169f / 255f); | |
221 | 221 | |
222 | 222 | /** |
223 | 223 | * The 'darkgreen' RGB color. |
@@ -307,7 +307,7 @@ | ||
307 | 307 | /** |
308 | 308 | * The 'dimgray' RGB color. |
309 | 309 | */ |
310 | - public static final ColorValue DIMGRAY = new GrayColorValue(105f / 255f); | |
310 | + public static final ColorValue DIMGRAY = fromGrayValue(105f / 255f); | |
311 | 311 | |
312 | 312 | /** |
313 | 313 | * The 'dimgrey' RGB color. |
@@ -437,7 +437,7 @@ | ||
437 | 437 | /** |
438 | 438 | * The 'lightgray' RGB color. |
439 | 439 | */ |
440 | - public static final ColorValue LIGHTGRAY = new GrayColorValue(211f / 255f); | |
440 | + public static final ColorValue LIGHTGRAY = fromGrayValue(211f / 255f); | |
441 | 441 | |
442 | 442 | /** |
443 | 443 | * The 'lightgreen' RGB color. |
@@ -1025,6 +1025,10 @@ | ||
1025 | 1025 | (float) black / 255f); |
1026 | 1026 | } |
1027 | 1027 | |
1028 | + public static ColorValue fromGrayValue(float g) { | |
1029 | + return new GrayColorValue(g); | |
1030 | + } | |
1031 | + | |
1028 | 1032 | public static ColorValue parseRGBHexColor(String color) { |
1029 | 1033 | int r, g, b; |
1030 | 1034 | try { |
@@ -0,0 +1,23 @@ | ||
1 | +package jp.cssj.homare.css.value; | |
2 | + | |
3 | +import jp.cssj.sakae.gc.paint.Paint; | |
4 | + | |
5 | +/** | |
6 | + * @author MIYABE Tatsuhiko | |
7 | + * @version $Id: ColorValue.java 1552 2018-04-26 01:43:24Z miyabe $ | |
8 | + */ | |
9 | +public class PaintValue implements Value { | |
10 | + protected final Paint paint; | |
11 | + | |
12 | + public PaintValue(Paint paint) { | |
13 | + this.paint = paint; | |
14 | + } | |
15 | + | |
16 | + public Paint getPaint() { | |
17 | + return this.paint; | |
18 | + } | |
19 | + | |
20 | + public short getValueType() { | |
21 | + return Value.TYPE_COLOR; | |
22 | + } | |
23 | +} | |
\ No newline at end of file |
@@ -287,8 +287,8 @@ | ||
287 | 287 | throw new IllegalStateException(); |
288 | 288 | } |
289 | 289 | } |
290 | - gc.end(); | |
291 | 290 | } |
291 | + gc.end(); | |
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |