126 Creates a color from a color constant value.
128 @param color_constant: A ColorConstant.
129 @param num_bits_per_pixel: Number of bits per pixel.
131 @exception NotSupportedException: If the color constant is unknown.
133 @return A Color object.
135 @since ids_peak_icv 1.0
138 if color_constant == ColorConstant.BLACK:
139 return Color.create_from_rgb(0, 0, 0, num_bits_per_pixel)
140 elif color_constant == ColorConstant.WHITE:
141 return Color.create_from_rgb(255, 255, 255, num_bits_per_pixel)
142 elif color_constant == ColorConstant.RED:
143 return Color.create_from_rgb(255, 0, 0, num_bits_per_pixel)
144 elif color_constant == ColorConstant.GREEN:
145 return Color.create_from_rgb(0, 255, 0, num_bits_per_pixel)
146 elif color_constant == ColorConstant.BLUE:
147 return Color.create_from_rgb(0, 0, 255, num_bits_per_pixel)
148 elif color_constant == ColorConstant.DIM_GRAY:
149 return Color.create_from_rgb(105, 105, 105, num_bits_per_pixel)
150 elif color_constant == ColorConstant.GRAY:
151 return Color.create_from_rgb(128, 128, 128, num_bits_per_pixel)
152 elif color_constant == ColorConstant.LIGHT_GRAY:
153 return Color.create_from_rgb(211, 211, 211, num_bits_per_pixel)
154 elif color_constant == ColorConstant.CYAN:
155 return Color.create_from_rgb(0, 255, 255, num_bits_per_pixel)
156 elif color_constant == ColorConstant.MAGENTA:
157 return Color.create_from_rgb(255, 0, 255, num_bits_per_pixel)
158 elif color_constant == ColorConstant.YELLOW:
159 return Color.create_from_rgb(255, 255, 0, num_bits_per_pixel)
160 elif color_constant == ColorConstant.MEDIUM_SLATE_BLUE:
161 return Color.create_from_rgb(123, 104, 238, num_bits_per_pixel)
162 elif color_constant == ColorConstant.CORAL:
163 return Color.create_from_rgb(255, 127, 80, num_bits_per_pixel)
164 elif color_constant == ColorConstant.SLATE_BLUE:
165 return Color.create_from_rgb(106, 90, 205, num_bits_per_pixel)
166 elif color_constant == ColorConstant.SPRING_GREEN:
167 return Color.create_from_rgb(0, 255, 127, num_bits_per_pixel)
168 elif color_constant == ColorConstant.ORANGE_RED:
169 return Color.create_from_rgb(255, 69, 0, num_bits_per_pixel)
170 elif color_constant == ColorConstant.DARK_OLIVE_GREEN:
171 return Color.create_from_rgb(85, 107, 47, num_bits_per_pixel)
172 elif color_constant == ColorConstant.PINK:
173 return Color.create_from_rgb(255, 192, 203, num_bits_per_pixel)
174 elif color_constant == ColorConstant.CADET_BLUE:
175 return Color.create_from_rgb(95, 158, 160, num_bits_per_pixel)
176 elif color_constant == ColorConstant.GOLDENROD:
177 return Color.create_from_rgb(218, 165, 32, num_bits_per_pixel)
178 elif color_constant == ColorConstant.ORANGE:
179 return Color.create_from_rgb(255, 165, 0, num_bits_per_pixel)
180 elif color_constant == ColorConstant.GOLD:
181 return Color.create_from_rgb(255, 215, 0, num_bits_per_pixel)
182 elif color_constant == ColorConstant.FOREST_GREEN:
183 return Color.create_from_rgb(34, 139, 34, num_bits_per_pixel)
184 elif color_constant == ColorConstant.CORNFLOWER_BLUE:
185 return Color.create_from_rgb(100, 149, 237, num_bits_per_pixel)
186 elif color_constant == ColorConstant.NAVY:
187 return Color.create_from_rgb(0, 0, 128, num_bits_per_pixel)
188 elif color_constant == ColorConstant.TURQUOISE:
189 return Color.create_from_rgb(64, 224, 208, num_bits_per_pixel)
190 elif color_constant == ColorConstant.DARK_SLATE_BLUE:
191 return Color.create_from_rgb(72, 61, 139, num_bits_per_pixel)
192 elif color_constant == ColorConstant.LIGHT_BLUE:
193 return Color.create_from_rgb(173, 216, 230, num_bits_per_pixel)
194 elif color_constant == ColorConstant.INDIAN_RED:
195 return Color.create_from_rgb(205, 92, 92, num_bits_per_pixel)
196 elif color_constant == ColorConstant.VIOLET_RED:
197 return Color.create_from_rgb(208, 32, 144, num_bits_per_pixel)
198 elif color_constant == ColorConstant.LIGHT_STEEL_BLUE:
199 return Color.create_from_rgb(176, 196, 222, num_bits_per_pixel)
200 elif color_constant == ColorConstant.MEDIUM_BLUE:
201 return Color.create_from_rgb(0, 0, 205, num_bits_per_pixel)
202 elif color_constant == ColorConstant.KHAKI:
203 return Color.create_from_rgb(240, 230, 140, num_bits_per_pixel)
204 elif color_constant == ColorConstant.VIOLET:
205 return Color.create_from_rgb(238, 130, 238, num_bits_per_pixel)
206 elif color_constant == ColorConstant.FIREBRICK:
207 return Color.create_from_rgb(178, 34, 34, num_bits_per_pixel)
208 elif color_constant == ColorConstant.MIDNIGHT_BLUE:
209 return Color.create_from_rgb(25, 25, 112, num_bits_per_pixel)