#include <color.h>
Represents a RGBA color
Definition at line 124 of file color.h.
◆ Color() [1/4]
constexpr impeller::Color::Color |
( |
| ) |
|
|
inlineconstexpr |
◆ Color() [2/4]
impeller::Color::Color |
( |
const ColorHSB & |
hsbColor | ) |
|
|
explicit |
◆ Color() [3/4]
impeller::Color::Color |
( |
const Vector4 & |
value | ) |
|
|
explicit |
◆ Color() [4/4]
◆ AliceBlue()
static constexpr Color impeller::Color::AliceBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 274 of file color.h.
274 {
275 return {240.0f / 255.0f, 248.0f / 255.0f, 255.0f / 255.0f, 1.0f};
276 }
◆ AntiqueWhite()
static constexpr Color impeller::Color::AntiqueWhite |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 278 of file color.h.
278 {
279 return {250.0f / 255.0f, 235.0f / 255.0f, 215.0f / 255.0f, 1.0f};
280 }
◆ ApplyColorMatrix()
Color impeller::Color::ApplyColorMatrix |
( |
const ColorMatrix & |
color_matrix | ) |
const |
A color filter that transforms colors through a 4x5 color matrix.
This filter can be used to change the saturation of pixels, convert
from YUV to RGB, etc.
Each channel of the output color is clamped to the 0 to 1 range.
- See also
ColorMatrix
Definition at line 378 of file color.cc.
378 {
379 auto* c = color_matrix.array;
385 .Clamp01();
386}
◆ Aqua()
static constexpr Color impeller::Color::Aqua |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 282 of file color.h.
282 {
283 return {0.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f, 1.0f};
284 }
◆ AquaMarine()
static constexpr Color impeller::Color::AquaMarine |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 286 of file color.h.
286 {
287 return {127.0f / 255.0f, 255.0f / 255.0f, 212.0f / 255.0f, 1.0f};
288 }
◆ Azure()
static constexpr Color impeller::Color::Azure |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 290 of file color.h.
290 {
291 return {240.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f, 1.0f};
292 }
◆ Beige()
static constexpr Color impeller::Color::Beige |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 294 of file color.h.
294 {
295 return {245.0f / 255.0f, 245.0f / 255.0f, 220.0f / 255.0f, 1.0f};
296 }
◆ Bisque()
static constexpr Color impeller::Color::Bisque |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 298 of file color.h.
298 {
299 return {255.0f / 255.0f, 228.0f / 255.0f, 196.0f / 255.0f, 1.0f};
300 }
◆ Black()
static constexpr Color impeller::Color::Black |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 258 of file color.h.
258{ return {0.0f, 0.0f, 0.0f, 1.0f}; }
◆ BlackTransparent()
static constexpr Color impeller::Color::BlackTransparent |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 262 of file color.h.
262{ return {0.0f, 0.0f, 0.0f, 0.0f}; }
◆ BlanchedAlmond()
static constexpr Color impeller::Color::BlanchedAlmond |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 302 of file color.h.
302 {
303 return {255.0f / 255.0f, 235.0f / 255.0f, 205.0f / 255.0f, 1.0f};
304 }
◆ Blend()
Blends an unpremultiplied destination color into a given unpremultiplied source color to form a new unpremultiplied color.
If either the source or destination are premultiplied, the result will be incorrect.
Definition at line 234 of file color.cc.
234 {
236
237 switch (blend_mode) {
245
246 return (
src.Premultiply() +
dst.Premultiply() * (1 -
src.alpha))
247 .Unpremultiply();
249
250 return (
dst.Premultiply() +
src.Premultiply() * (1 -
dst.alpha))
251 .Unpremultiply();
253
254 return (
src.Premultiply() *
dst.alpha).Unpremultiply();
256
257 return (
dst.Premultiply() *
src.alpha).Unpremultiply();
259
260 return (
src.Premultiply() * (1 -
dst.alpha)).Unpremultiply();
262
263 return (
dst.Premultiply() * (1 -
src.alpha)).Unpremultiply();
265
266 return (
src.Premultiply() *
dst.alpha +
267 dst.Premultiply() * (1 -
src.alpha))
268 .Unpremultiply();
270
271 return (
dst.Premultiply() *
src.alpha +
272 src.Premultiply() * (1 -
dst.alpha))
273 .Unpremultiply();
275
276 return (
src.Premultiply() * (1 -
dst.alpha) +
277 dst.Premultiply() * (1 -
src.alpha))
278 .Unpremultiply();
280
281 return (
Min(
src.Premultiply() +
dst.Premultiply(), 1)).Unpremultiply();
283
284 return (
src.Premultiply() *
dst.Premultiply()).Unpremultiply();
286 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
287 return s +
d -
s *
d;
288 });
289 }
291 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
292
293 Vector3 screen_src = 2.0 *
d - 1.0;
294 Vector3 screen = screen_src +
s - screen_src *
s;
296 screen,
298 0.5);
299 });
302 dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
return d.Min(
s); });
305 dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
return d.Max(
s); });
309 return 0.0f;
310 }
312 return 1.0f;
313 }
314 return std::min(1.0f,
d / (1.0f -
s));
315 });
319 return 1.0f;
320 }
322 return 0.0f;
323 }
324 return 1.0f - std::min(1.0f, (1.0f -
d) /
s);
325 });
327 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
328 Vector3 screen_src = 2.0 *
s - 1.0;
329 Vector3 screen = screen_src +
d - screen_src *
d;
331 screen,
333 0.5);
334 });
336 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
338 Vector3(std::sqrt(
d.x), std::sqrt(
d.y),
341 0.25);
343 d + (2.0 *
s - 1.0) * (
D -
d),
345 0.5);
346 });
348 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
349 return (
d -
s).Abs();
350 });
352 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
353 return d +
s - 2.0f *
d *
s;
354 });
357 dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
return d *
s; });
359 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
361 });
362 }
364 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
366 });
368 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
370 });
372 return DoColorBlend(dst, src, [](Vector3
d, Vector3
s) -> Vector3 {
374 });
375 }
376}
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
static constexpr Color Min(Color c, float threshold)
static constexpr Vector3 SetSaturation(Vector3 color, Scalar saturation)
constexpr float kEhCloseEnough
static constexpr Scalar Saturation(Vector3 color)
static constexpr Vector3 SetLuminosity(Vector3 color, Scalar luminosity)
static constexpr Color DoColorBlend(Color dst, Color src, const std::function< Vector3(Vector3, Vector3)> &blend_rgb_func)
static constexpr Color DoColorBlendComponents(Color dst, Color src, const std::function< Scalar(Scalar, Scalar)> &blend_func)
static constexpr Vector3 ComponentChoose(Vector3 a, Vector3 b, Vector3 value, Scalar cutoff)
static constexpr Scalar Luminosity(Vector3 color)
static constexpr Color BlackTransparent()
◆ Blue()
static constexpr Color impeller::Color::Blue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 268 of file color.h.
268{ return {0.0f, 0.0f, 1.0f, 1.0f}; }
◆ BlueViolet()
static constexpr Color impeller::Color::BlueViolet |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 306 of file color.h.
306 {
307 return {138.0f / 255.0f, 43.0f / 255.0f, 226.0f / 255.0f, 1.0f};
308 }
◆ Brown()
static constexpr Color impeller::Color::Brown |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 310 of file color.h.
310 {
311 return {165.0f / 255.0f, 42.0f / 255.0f, 42.0f / 255.0f, 1.0f};
312 }
◆ BurlyWood()
static constexpr Color impeller::Color::BurlyWood |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 314 of file color.h.
314 {
315 return {222.0f / 255.0f, 184.0f / 255.0f, 135.0f / 255.0f, 1.0f};
316 }
◆ CadetBlue()
static constexpr Color impeller::Color::CadetBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 318 of file color.h.
318 {
319 return {95.0f / 255.0f, 158.0f / 255.0f, 160.0f / 255.0f, 1.0f};
320 }
◆ Chartreuse()
static constexpr Color impeller::Color::Chartreuse |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 322 of file color.h.
322 {
323 return {127.0f / 255.0f, 255.0f / 255.0f, 0.0f / 255.0f, 1.0f};
324 }
◆ Chocolate()
static constexpr Color impeller::Color::Chocolate |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 326 of file color.h.
326 {
327 return {210.0f / 255.0f, 105.0f / 255.0f, 30.0f / 255.0f, 1.0f};
328 }
◆ Clamp01()
constexpr Color impeller::Color::Clamp01 |
( |
| ) |
const |
|
inlineconstexpr |
Definition at line 238 of file color.h.
238 {
239 return Color(std::clamp(
red, 0.0f, 1.0f), std::clamp(
green, 0.0f, 1.0f),
240 std::clamp(
blue, 0.0f, 1.0f), std::clamp(
alpha, 0.0f, 1.0f));
241 }
◆ Coral()
static constexpr Color impeller::Color::Coral |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 330 of file color.h.
330 {
331 return {255.0f / 255.0f, 127.0f / 255.0f, 80.0f / 255.0f, 1.0f};
332 }
◆ CornflowerBlue()
static constexpr Color impeller::Color::CornflowerBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 334 of file color.h.
334 {
335 return {100.0f / 255.0f, 149.0f / 255.0f, 237.0f / 255.0f, 1.0f};
336 }
◆ Cornsilk()
static constexpr Color impeller::Color::Cornsilk |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 338 of file color.h.
338 {
339 return {255.0f / 255.0f, 248.0f / 255.0f, 220.0f / 255.0f, 1.0f};
340 }
◆ Crimson()
static constexpr Color impeller::Color::Crimson |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 342 of file color.h.
342 {
343 return {220.0f / 255.0f, 20.0f / 255.0f, 60.0f / 255.0f, 1.0f};
344 }
◆ Cyan()
static constexpr Color impeller::Color::Cyan |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 346 of file color.h.
346 {
347 return {0.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f, 1.0f};
348 }
◆ DarkBlue()
static constexpr Color impeller::Color::DarkBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 350 of file color.h.
350 {
351 return {0.0f / 255.0f, 0.0f / 255.0f, 139.0f / 255.0f, 1.0f};
352 }
◆ DarkCyan()
static constexpr Color impeller::Color::DarkCyan |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 354 of file color.h.
354 {
355 return {0.0f / 255.0f, 139.0f / 255.0f, 139.0f / 255.0f, 1.0f};
356 }
◆ DarkGoldenrod()
static constexpr Color impeller::Color::DarkGoldenrod |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 358 of file color.h.
358 {
359 return {184.0f / 255.0f, 134.0f / 255.0f, 11.0f / 255.0f, 1.0f};
360 }
◆ DarkGray()
static constexpr Color impeller::Color::DarkGray |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 362 of file color.h.
362 {
363 return {169.0f / 255.0f, 169.0f / 255.0f, 169.0f / 255.0f, 1.0f};
364 }
◆ DarkGreen()
static constexpr Color impeller::Color::DarkGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 366 of file color.h.
366 {
367 return {0.0f / 255.0f, 100.0f / 255.0f, 0.0f / 255.0f, 1.0f};
368 }
◆ DarkGrey()
static constexpr Color impeller::Color::DarkGrey |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 370 of file color.h.
370 {
371 return {169.0f / 255.0f, 169.0f / 255.0f, 169.0f / 255.0f, 1.0f};
372 }
◆ DarkKhaki()
static constexpr Color impeller::Color::DarkKhaki |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 374 of file color.h.
374 {
375 return {189.0f / 255.0f, 183.0f / 255.0f, 107.0f / 255.0f, 1.0f};
376 }
◆ DarkMagenta()
static constexpr Color impeller::Color::DarkMagenta |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 378 of file color.h.
378 {
379 return {139.0f / 255.0f, 0.0f / 255.0f, 139.0f / 255.0f, 1.0f};
380 }
◆ DarkOliveGreen()
static constexpr Color impeller::Color::DarkOliveGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 382 of file color.h.
382 {
383 return {85.0f / 255.0f, 107.0f / 255.0f, 47.0f / 255.0f, 1.0f};
384 }
◆ DarkOrange()
static constexpr Color impeller::Color::DarkOrange |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 386 of file color.h.
386 {
387 return {255.0f / 255.0f, 140.0f / 255.0f, 0.0f / 255.0f, 1.0f};
388 }
◆ DarkOrchid()
static constexpr Color impeller::Color::DarkOrchid |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 390 of file color.h.
390 {
391 return {153.0f / 255.0f, 50.0f / 255.0f, 204.0f / 255.0f, 1.0f};
392 }
◆ DarkRed()
static constexpr Color impeller::Color::DarkRed |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 394 of file color.h.
394 {
395 return {139.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f, 1.0f};
396 }
◆ DarkSalmon()
static constexpr Color impeller::Color::DarkSalmon |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 398 of file color.h.
398 {
399 return {233.0f / 255.0f, 150.0f / 255.0f, 122.0f / 255.0f, 1.0f};
400 }
◆ DarkSeagreen()
static constexpr Color impeller::Color::DarkSeagreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 402 of file color.h.
402 {
403 return {143.0f / 255.0f, 188.0f / 255.0f, 143.0f / 255.0f, 1.0f};
404 }
◆ DarkSlateBlue()
static constexpr Color impeller::Color::DarkSlateBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 406 of file color.h.
406 {
407 return {72.0f / 255.0f, 61.0f / 255.0f, 139.0f / 255.0f, 1.0f};
408 }
◆ DarkSlateGray()
static constexpr Color impeller::Color::DarkSlateGray |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 410 of file color.h.
410 {
411 return {47.0f / 255.0f, 79.0f / 255.0f, 79.0f / 255.0f, 1.0f};
412 }
◆ DarkSlateGrey()
static constexpr Color impeller::Color::DarkSlateGrey |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 414 of file color.h.
414 {
415 return {47.0f / 255.0f, 79.0f / 255.0f, 79.0f / 255.0f, 1.0f};
416 }
◆ DarkTurquoise()
static constexpr Color impeller::Color::DarkTurquoise |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 418 of file color.h.
418 {
419 return {0.0f / 255.0f, 206.0f / 255.0f, 209.0f / 255.0f, 1.0f};
420 }
◆ DarkViolet()
static constexpr Color impeller::Color::DarkViolet |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 422 of file color.h.
422 {
423 return {148.0f / 255.0f, 0.0f / 255.0f, 211.0f / 255.0f, 1.0f};
424 }
◆ DeepPink()
static constexpr Color impeller::Color::DeepPink |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 426 of file color.h.
426 {
427 return {255.0f / 255.0f, 20.0f / 255.0f, 147.0f / 255.0f, 1.0f};
428 }
◆ DeepSkyBlue()
static constexpr Color impeller::Color::DeepSkyBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 430 of file color.h.
430 {
431 return {0.0f / 255.0f, 191.0f / 255.0f, 255.0f / 255.0f, 1.0f};
432 }
◆ DimGray()
static constexpr Color impeller::Color::DimGray |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 434 of file color.h.
434 {
435 return {105.0f / 255.0f, 105.0f / 255.0f, 105.0f / 255.0f, 1.0f};
436 }
◆ DimGrey()
static constexpr Color impeller::Color::DimGrey |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 438 of file color.h.
438 {
439 return {105.0f / 255.0f, 105.0f / 255.0f, 105.0f / 255.0f, 1.0f};
440 }
◆ DodgerBlue()
static constexpr Color impeller::Color::DodgerBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 442 of file color.h.
442 {
443 return {30.0f / 255.0f, 144.0f / 255.0f, 255.0f / 255.0f, 1.0f};
444 }
◆ Firebrick()
static constexpr Color impeller::Color::Firebrick |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 446 of file color.h.
446 {
447 return {178.0f / 255.0f, 34.0f / 255.0f, 34.0f / 255.0f, 1.0f};
448 }
◆ FloralWhite()
static constexpr Color impeller::Color::FloralWhite |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 450 of file color.h.
450 {
451 return {255.0f / 255.0f, 250.0f / 255.0f, 240.0f / 255.0f, 1.0f};
452 }
◆ ForestGreen()
static constexpr Color impeller::Color::ForestGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 454 of file color.h.
454 {
455 return {34.0f / 255.0f, 139.0f / 255.0f, 34.0f / 255.0f, 1.0f};
456 }
◆ Fuchsia()
static constexpr Color impeller::Color::Fuchsia |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 458 of file color.h.
458 {
459 return {255.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f, 1.0f};
460 }
◆ Gainsboro()
static constexpr Color impeller::Color::Gainsboro |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 462 of file color.h.
462 {
463 return {220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f, 1.0f};
464 }
◆ Ghostwhite()
static constexpr Color impeller::Color::Ghostwhite |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 466 of file color.h.
466 {
467 return {248.0f / 255.0f, 248.0f / 255.0f, 255.0f / 255.0f, 1.0f};
468 }
◆ Gold()
static constexpr Color impeller::Color::Gold |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 470 of file color.h.
470 {
471 return {255.0f / 255.0f, 215.0f / 255.0f, 0.0f / 255.0f, 1.0f};
472 }
◆ Goldenrod()
static constexpr Color impeller::Color::Goldenrod |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 474 of file color.h.
474 {
475 return {218.0f / 255.0f, 165.0f / 255.0f, 32.0f / 255.0f, 1.0f};
476 }
◆ Gray()
static constexpr Color impeller::Color::Gray |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 478 of file color.h.
478 {
479 return {128.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f, 1.0f};
480 }
◆ Green()
static constexpr Color impeller::Color::Green |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 266 of file color.h.
266{ return {0.0f, 1.0f, 0.0f, 1.0f}; }
◆ GreenYellow()
static constexpr Color impeller::Color::GreenYellow |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 482 of file color.h.
482 {
483 return {173.0f / 255.0f, 255.0f / 255.0f, 47.0f / 255.0f, 1.0f};
484 }
◆ Grey()
static constexpr Color impeller::Color::Grey |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 486 of file color.h.
486 {
487 return {128.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f, 1.0f};
488 }
◆ Honeydew()
static constexpr Color impeller::Color::Honeydew |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 490 of file color.h.
490 {
491 return {240.0f / 255.0f, 255.0f / 255.0f, 240.0f / 255.0f, 1.0f};
492 }
◆ HotPink()
static constexpr Color impeller::Color::HotPink |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 494 of file color.h.
494 {
495 return {255.0f / 255.0f, 105.0f / 255.0f, 180.0f / 255.0f, 1.0f};
496 }
◆ IndianRed()
static constexpr Color impeller::Color::IndianRed |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 498 of file color.h.
498 {
499 return {205.0f / 255.0f, 92.0f / 255.0f, 92.0f / 255.0f, 1.0f};
500 }
◆ Indigo()
static constexpr Color impeller::Color::Indigo |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 502 of file color.h.
502 {
503 return {75.0f / 255.0f, 0.0f / 255.0f, 130.0f / 255.0f, 1.0f};
504 }
◆ IsOpaque()
constexpr bool impeller::Color::IsOpaque |
( |
| ) |
const |
|
inlineconstexpr |
◆ IsTransparent()
constexpr bool impeller::Color::IsTransparent |
( |
| ) |
const |
|
inlineconstexpr |
◆ Ivory()
static constexpr Color impeller::Color::Ivory |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 506 of file color.h.
506 {
507 return {255.0f / 255.0f, 255.0f / 255.0f, 240.0f / 255.0f, 1.0f};
508 }
◆ Khaki()
static constexpr Color impeller::Color::Khaki |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 510 of file color.h.
510 {
511 return {240.0f / 255.0f, 230.0f / 255.0f, 140.0f / 255.0f, 1.0f};
512 }
◆ Lavender()
static constexpr Color impeller::Color::Lavender |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 514 of file color.h.
514 {
515 return {230.0f / 255.0f, 230.0f / 255.0f, 250.0f / 255.0f, 1.0f};
516 }
◆ LavenderBlush()
static constexpr Color impeller::Color::LavenderBlush |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 518 of file color.h.
518 {
519 return {255.0f / 255.0f, 240.0f / 255.0f, 245.0f / 255.0f, 1.0f};
520 }
◆ LawnGreen()
static constexpr Color impeller::Color::LawnGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 522 of file color.h.
522 {
523 return {124.0f / 255.0f, 252.0f / 255.0f, 0.0f / 255.0f, 1.0f};
524 }
◆ LemonChiffon()
static constexpr Color impeller::Color::LemonChiffon |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 526 of file color.h.
526 {
527 return {255.0f / 255.0f, 250.0f / 255.0f, 205.0f / 255.0f, 1.0f};
528 }
◆ Lerp()
Return a color that is linearly interpolated between colors a and b, according to the value of t.
- Parameters
-
a | The lower color. |
b | The upper color. |
t | A value between 0.0f and 1.0f, inclusive. |
- Returns
- constexpr Color
Definition at line 234 of file color.h.
234 {
235 return a + (
b -
a) * t;
236 }
◆ LightBlue()
static constexpr Color impeller::Color::LightBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 530 of file color.h.
530 {
531 return {173.0f / 255.0f, 216.0f / 255.0f, 230.0f / 255.0f, 1.0f};
532 }
◆ LightCoral()
static constexpr Color impeller::Color::LightCoral |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 534 of file color.h.
534 {
535 return {240.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f, 1.0f};
536 }
◆ LightCyan()
static constexpr Color impeller::Color::LightCyan |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 538 of file color.h.
538 {
539 return {224.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f, 1.0f};
540 }
◆ LightGoldenrodYellow()
static constexpr Color impeller::Color::LightGoldenrodYellow |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 542 of file color.h.
542 {
543 return {50.0f / 255.0f, 250.0f / 255.0f, 210.0f / 255.0f, 1.0f};
544 }
◆ LightGray()
static constexpr Color impeller::Color::LightGray |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 546 of file color.h.
546 {
547 return {211.0f / 255.0f, 211.0f / 255.0f, 211.0f / 255.0f, 1.0f};
548 }
◆ LightGreen()
static constexpr Color impeller::Color::LightGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 550 of file color.h.
550 {
551 return {144.0f / 255.0f, 238.0f / 255.0f, 144.0f / 255.0f, 1.0f};
552 }
◆ LightGrey()
static constexpr Color impeller::Color::LightGrey |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 554 of file color.h.
554 {
555 return {211.0f / 255.0f, 211.0f / 255.0f, 211.0f / 255.0f, 1.0f};
556 }
◆ LightPink()
static constexpr Color impeller::Color::LightPink |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 558 of file color.h.
558 {
559 return {255.0f / 255.0f, 182.0f / 255.0f, 193.0f / 255.0f, 1.0f};
560 }
◆ LightSalmon()
static constexpr Color impeller::Color::LightSalmon |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 562 of file color.h.
562 {
563 return {255.0f / 255.0f, 160.0f / 255.0f, 122.0f / 255.0f, 1.0f};
564 }
◆ LightSeaGreen()
static constexpr Color impeller::Color::LightSeaGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 566 of file color.h.
566 {
567 return {32.0f / 255.0f, 178.0f / 255.0f, 170.0f / 255.0f, 1.0f};
568 }
◆ LightSkyBlue()
static constexpr Color impeller::Color::LightSkyBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 570 of file color.h.
570 {
571 return {135.0f / 255.0f, 206.0f / 255.0f, 250.0f / 255.0f, 1.0f};
572 }
◆ LightSlateGray()
static constexpr Color impeller::Color::LightSlateGray |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 574 of file color.h.
574 {
575 return {119.0f / 255.0f, 136.0f / 255.0f, 153.0f / 255.0f, 1.0f};
576 }
◆ LightSlateGrey()
static constexpr Color impeller::Color::LightSlateGrey |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 578 of file color.h.
578 {
579 return {119.0f / 255.0f, 136.0f / 255.0f, 153.0f / 255.0f, 1.0f};
580 }
◆ LightSteelBlue()
static constexpr Color impeller::Color::LightSteelBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 582 of file color.h.
582 {
583 return {176.0f / 255.0f, 196.0f / 255.0f, 222.0f / 255.0f, 1.0f};
584 }
◆ LightYellow()
static constexpr Color impeller::Color::LightYellow |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 586 of file color.h.
586 {
587 return {255.0f / 255.0f, 255.0f / 255.0f, 224.0f / 255.0f, 1.0f};
588 }
◆ Lime()
static constexpr Color impeller::Color::Lime |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 590 of file color.h.
590 {
591 return {0.0f / 255.0f, 255.0f / 255.0f, 0.0f / 255.0f, 1.0f};
592 }
◆ LimeGreen()
static constexpr Color impeller::Color::LimeGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 594 of file color.h.
594 {
595 return {50.0f / 255.0f, 205.0f / 255.0f, 50.0f / 255.0f, 1.0f};
596 }
◆ LinearToSRGB()
Color impeller::Color::LinearToSRGB |
( |
| ) |
const |
Convert the color from linear space to sRGB space.
The color is assumed to be unpremultiplied. If the color is
premultipled, the conversion output will be incorrect.
Definition at line 388 of file color.cc.
388 {
389 static auto conversion = [](
Scalar component) {
390 if (component <= 0.0031308) {
391 return component * 12.92;
392 }
393 return 1.055 * pow(component, (1.0 / 2.4)) - 0.055;
394 };
395
397}
◆ Linen()
static constexpr Color impeller::Color::Linen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 598 of file color.h.
598 {
599 return {250.0f / 255.0f, 240.0f / 255.0f, 230.0f / 255.0f, 1.0f};
600 }
◆ Magenta()
static constexpr Color impeller::Color::Magenta |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 602 of file color.h.
602 {
603 return {255.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f, 1.0f};
604 }
◆ MakeRGBA8()
static constexpr Color impeller::Color::MakeRGBA8 |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
uint8_t |
a |
|
) |
| |
|
inlinestaticconstexpr |
Definition at line 154 of file color.h.
154 {
156 static_cast<Scalar>(r) / 255.0f,
static_cast<Scalar>(g) / 255.0f,
157 static_cast<Scalar>(
b) / 255.0f,
static_cast<Scalar>(
a) / 255.0f);
158 }
◆ Maroon()
static constexpr Color impeller::Color::Maroon |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 606 of file color.h.
606 {
607 return {128.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f, 1.0f};
608 }
◆ MediumAquamarine()
static constexpr Color impeller::Color::MediumAquamarine |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 610 of file color.h.
610 {
611 return {102.0f / 255.0f, 205.0f / 255.0f, 170.0f / 255.0f, 1.0f};
612 }
◆ MediumBlue()
static constexpr Color impeller::Color::MediumBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 614 of file color.h.
614 {
615 return {0.0f / 255.0f, 0.0f / 255.0f, 205.0f / 255.0f, 1.0f};
616 }
◆ MediumOrchid()
static constexpr Color impeller::Color::MediumOrchid |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 618 of file color.h.
618 {
619 return {186.0f / 255.0f, 85.0f / 255.0f, 211.0f / 255.0f, 1.0f};
620 }
◆ MediumPurple()
static constexpr Color impeller::Color::MediumPurple |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 622 of file color.h.
622 {
623 return {147.0f / 255.0f, 112.0f / 255.0f, 219.0f / 255.0f, 1.0f};
624 }
◆ MediumSeagreen()
static constexpr Color impeller::Color::MediumSeagreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 626 of file color.h.
626 {
627 return {60.0f / 255.0f, 179.0f / 255.0f, 113.0f / 255.0f, 1.0f};
628 }
◆ MediumSlateBlue()
static constexpr Color impeller::Color::MediumSlateBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 630 of file color.h.
630 {
631 return {123.0f / 255.0f, 104.0f / 255.0f, 238.0f / 255.0f, 1.0f};
632 }
◆ MediumSpringGreen()
static constexpr Color impeller::Color::MediumSpringGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 634 of file color.h.
634 {
635 return {0.0f / 255.0f, 250.0f / 255.0f, 154.0f / 255.0f, 1.0f};
636 }
◆ MediumTurquoise()
static constexpr Color impeller::Color::MediumTurquoise |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 638 of file color.h.
638 {
639 return {72.0f / 255.0f, 209.0f / 255.0f, 204.0f / 255.0f, 1.0f};
640 }
◆ MediumVioletRed()
static constexpr Color impeller::Color::MediumVioletRed |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 642 of file color.h.
642 {
643 return {199.0f / 255.0f, 21.0f / 255.0f, 133.0f / 255.0f, 1.0f};
644 }
◆ MidnightBlue()
static constexpr Color impeller::Color::MidnightBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 646 of file color.h.
646 {
647 return {25.0f / 255.0f, 25.0f / 255.0f, 112.0f / 255.0f, 1.0f};
648 }
◆ MintCream()
static constexpr Color impeller::Color::MintCream |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 650 of file color.h.
650 {
651 return {245.0f / 255.0f, 255.0f / 255.0f, 250.0f / 255.0f, 1.0f};
652 }
◆ MistyRose()
static constexpr Color impeller::Color::MistyRose |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 654 of file color.h.
654 {
655 return {255.0f / 255.0f, 228.0f / 255.0f, 225.0f / 255.0f, 1.0f};
656 }
◆ Moccasin()
static constexpr Color impeller::Color::Moccasin |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 658 of file color.h.
658 {
659 return {255.0f / 255.0f, 228.0f / 255.0f, 181.0f / 255.0f, 1.0f};
660 }
◆ NavajoWhite()
static constexpr Color impeller::Color::NavajoWhite |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 662 of file color.h.
662 {
663 return {255.0f / 255.0f, 222.0f / 255.0f, 173.0f / 255.0f, 1.0f};
664 }
◆ Navy()
static constexpr Color impeller::Color::Navy |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 666 of file color.h.
666 {
667 return {0.0f / 255.0f, 0.0f / 255.0f, 128.0f / 255.0f, 1.0f};
668 }
◆ OldLace()
static constexpr Color impeller::Color::OldLace |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 670 of file color.h.
670 {
671 return {253.0f / 255.0f, 245.0f / 255.0f, 230.0f / 255.0f, 1.0f};
672 }
◆ Olive()
static constexpr Color impeller::Color::Olive |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 674 of file color.h.
674 {
675 return {128.0f / 255.0f, 128.0f / 255.0f, 0.0f / 255.0f, 1.0f};
676 }
◆ OliveDrab()
static constexpr Color impeller::Color::OliveDrab |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 678 of file color.h.
678 {
679 return {107.0f / 255.0f, 142.0f / 255.0f, 35.0f / 255.0f, 1.0f};
680 }
◆ operator*() [1/2]
constexpr Color impeller::Color::operator* |
( |
const Color & |
c | ) |
const |
|
inlineconstexpr |
◆ operator*() [2/2]
template<class
T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color impeller::Color::operator* |
( |
T |
value | ) |
const |
|
inlineconstexpr |
◆ operator+() [1/2]
constexpr Color impeller::Color::operator+ |
( |
const Color & |
c | ) |
const |
|
inlineconstexpr |
◆ operator+() [2/2]
template<class
T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color impeller::Color::operator+ |
( |
T |
value | ) |
const |
|
inlineconstexpr |
◆ operator-() [1/2]
constexpr Color impeller::Color::operator- |
( |
const Color & |
c | ) |
const |
|
inlineconstexpr |
◆ operator-() [2/2]
template<class
T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color impeller::Color::operator- |
( |
T |
value | ) |
const |
|
inlineconstexpr |
◆ operator/() [1/2]
constexpr Color impeller::Color::operator/ |
( |
const Color & |
c | ) |
const |
|
inlineconstexpr |
◆ operator/() [2/2]
template<class
T , class = std::enable_if_t<std::is_arithmetic_v<T>>>
constexpr Color impeller::Color::operator/ |
( |
T |
value | ) |
const |
|
inlineconstexpr |
◆ operator==()
constexpr bool impeller::Color::operator== |
( |
const Color & |
c | ) |
const |
|
inlineconstexpr |
Definition at line 169 of file color.h.
169 {
172 }
constexpr bool ScalarNearlyEqual(Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
◆ Orange()
static constexpr Color impeller::Color::Orange |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 682 of file color.h.
682 {
683 return {255.0f / 255.0f, 165.0f / 255.0f, 0.0f / 255.0f, 1.0f};
684 }
◆ OrangeRed()
static constexpr Color impeller::Color::OrangeRed |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 686 of file color.h.
686 {
687 return {255.0f / 255.0f, 69.0f / 255.0f, 0.0f / 255.0f, 1.0f};
688 }
◆ Orchid()
static constexpr Color impeller::Color::Orchid |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 690 of file color.h.
690 {
691 return {218.0f / 255.0f, 112.0f / 255.0f, 214.0f / 255.0f, 1.0f};
692 }
◆ PaleGoldenrod()
static constexpr Color impeller::Color::PaleGoldenrod |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 694 of file color.h.
694 {
695 return {238.0f / 255.0f, 232.0f / 255.0f, 170.0f / 255.0f, 1.0f};
696 }
◆ PaleGreen()
static constexpr Color impeller::Color::PaleGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 698 of file color.h.
698 {
699 return {152.0f / 255.0f, 251.0f / 255.0f, 152.0f / 255.0f, 1.0f};
700 }
◆ PaleTurquoise()
static constexpr Color impeller::Color::PaleTurquoise |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 702 of file color.h.
702 {
703 return {175.0f / 255.0f, 238.0f / 255.0f, 238.0f / 255.0f, 1.0f};
704 }
◆ PaleVioletRed()
static constexpr Color impeller::Color::PaleVioletRed |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 706 of file color.h.
706 {
707 return {219.0f / 255.0f, 112.0f / 255.0f, 147.0f / 255.0f, 1.0f};
708 }
◆ PapayaWhip()
static constexpr Color impeller::Color::PapayaWhip |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 710 of file color.h.
710 {
711 return {255.0f / 255.0f, 239.0f / 255.0f, 213.0f / 255.0f, 1.0f};
712 }
◆ Peachpuff()
static constexpr Color impeller::Color::Peachpuff |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 714 of file color.h.
714 {
715 return {255.0f / 255.0f, 218.0f / 255.0f, 185.0f / 255.0f, 1.0f};
716 }
◆ Peru()
static constexpr Color impeller::Color::Peru |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 718 of file color.h.
718 {
719 return {205.0f / 255.0f, 133.0f / 255.0f, 63.0f / 255.0f, 1.0f};
720 }
◆ Pink()
static constexpr Color impeller::Color::Pink |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 722 of file color.h.
722 {
723 return {255.0f / 255.0f, 192.0f / 255.0f, 203.0f / 255.0f, 1.0f};
724 }
◆ Plum()
static constexpr Color impeller::Color::Plum |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 726 of file color.h.
726 {
727 return {221.0f / 255.0f, 160.0f / 255.0f, 221.0f / 255.0f, 1.0f};
728 }
◆ PowderBlue()
static constexpr Color impeller::Color::PowderBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 730 of file color.h.
730 {
731 return {176.0f / 255.0f, 224.0f / 255.0f, 230.0f / 255.0f, 1.0f};
732 }
◆ Premultiply()
constexpr Color impeller::Color::Premultiply |
( |
| ) |
const |
|
inlineconstexpr |
◆ Purple()
static constexpr Color impeller::Color::Purple |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 734 of file color.h.
734 {
735 return {128.0f / 255.0f, 0.0f / 255.0f, 128.0f / 255.0f, 1.0f};
736 }
◆ Random()
static Color impeller::Color::Random |
( |
| ) |
|
|
inlinestatic |
Definition at line 842 of file color.h.
842 {
843 return {
844
845
846 static_cast<Scalar>((std::rand() % 255) / 255.0f),
847 static_cast<Scalar>((std::rand() % 255) / 255.0f),
848 static_cast<Scalar>((std::rand() % 255) / 255.0f),
849
850 1.0f
851
852 };
853 }
◆ Red()
static constexpr Color impeller::Color::Red |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 264 of file color.h.
264{ return {1.0f, 0.0f, 0.0f, 1.0f}; }
◆ RosyBrown()
static constexpr Color impeller::Color::RosyBrown |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 738 of file color.h.
738 {
739 return {188.0f / 255.0f, 143.0f / 255.0f, 143.0f / 255.0f, 1.0f};
740 }
◆ RoyalBlue()
static constexpr Color impeller::Color::RoyalBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 742 of file color.h.
742 {
743 return {65.0f / 255.0f, 105.0f / 255.0f, 225.0f / 255.0f, 1.0f};
744 }
◆ SaddleBrown()
static constexpr Color impeller::Color::SaddleBrown |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 746 of file color.h.
746 {
747 return {139.0f / 255.0f, 69.0f / 255.0f, 19.0f / 255.0f, 1.0f};
748 }
◆ Salmon()
static constexpr Color impeller::Color::Salmon |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 750 of file color.h.
750 {
751 return {250.0f / 255.0f, 128.0f / 255.0f, 114.0f / 255.0f, 1.0f};
752 }
◆ SandyBrown()
static constexpr Color impeller::Color::SandyBrown |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 754 of file color.h.
754 {
755 return {244.0f / 255.0f, 164.0f / 255.0f, 96.0f / 255.0f, 1.0f};
756 }
◆ Seagreen()
static constexpr Color impeller::Color::Seagreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 758 of file color.h.
758 {
759 return {46.0f / 255.0f, 139.0f / 255.0f, 87.0f / 255.0f, 1.0f};
760 }
◆ Seashell()
static constexpr Color impeller::Color::Seashell |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 762 of file color.h.
762 {
763 return {255.0f / 255.0f, 245.0f / 255.0f, 238.0f / 255.0f, 1.0f};
764 }
◆ Sienna()
static constexpr Color impeller::Color::Sienna |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 766 of file color.h.
766 {
767 return {160.0f / 255.0f, 82.0f / 255.0f, 45.0f / 255.0f, 1.0f};
768 }
◆ Silver()
static constexpr Color impeller::Color::Silver |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 770 of file color.h.
770 {
771 return {192.0f / 255.0f, 192.0f / 255.0f, 192.0f / 255.0f, 1.0f};
772 }
◆ SkyBlue()
static constexpr Color impeller::Color::SkyBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 774 of file color.h.
774 {
775 return {135.0f / 255.0f, 206.0f / 255.0f, 235.0f / 255.0f, 1.0f};
776 }
◆ SlateBlue()
static constexpr Color impeller::Color::SlateBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 778 of file color.h.
778 {
779 return {106.0f / 255.0f, 90.0f / 255.0f, 205.0f / 255.0f, 1.0f};
780 }
◆ SlateGray()
static constexpr Color impeller::Color::SlateGray |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 782 of file color.h.
782 {
783 return {112.0f / 255.0f, 128.0f / 255.0f, 144.0f / 255.0f, 1.0f};
784 }
◆ SlateGrey()
static constexpr Color impeller::Color::SlateGrey |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 786 of file color.h.
786 {
787 return {112.0f / 255.0f, 128.0f / 255.0f, 144.0f / 255.0f, 1.0f};
788 }
◆ Snow()
static constexpr Color impeller::Color::Snow |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 790 of file color.h.
790 {
791 return {255.0f / 255.0f, 250.0f / 255.0f, 250.0f / 255.0f, 1.0f};
792 }
◆ SpringGreen()
static constexpr Color impeller::Color::SpringGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 794 of file color.h.
794 {
795 return {0.0f / 255.0f, 255.0f / 255.0f, 127.0f / 255.0f, 1.0f};
796 }
◆ SRGBToLinear()
Color impeller::Color::SRGBToLinear |
( |
| ) |
const |
Convert the color from sRGB space to linear space.
The color is assumed to be unpremultiplied. If the color is
premultipled, the conversion output will be incorrect.
Definition at line 399 of file color.cc.
399 {
400 static auto conversion = [](
Scalar component) {
401 if (component <= 0.04045) {
402 return component / 12.92;
403 }
404 return pow((component + 0.055) / 1.055, 2.4);
405 };
406
408}
◆ SteelBlue()
static constexpr Color impeller::Color::SteelBlue |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 798 of file color.h.
798 {
799 return {70.0f / 255.0f, 130.0f / 255.0f, 180.0f / 255.0f, 1.0f};
800 }
◆ Tan()
static constexpr Color impeller::Color::Tan |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 802 of file color.h.
802 {
803 return {210.0f / 255.0f, 180.0f / 255.0f, 140.0f / 255.0f, 1.0f};
804 }
◆ Teal()
static constexpr Color impeller::Color::Teal |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 806 of file color.h.
806 {
807 return {0.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f, 1.0f};
808 }
◆ Thistle()
static constexpr Color impeller::Color::Thistle |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 810 of file color.h.
810 {
811 return {216.0f / 255.0f, 191.0f / 255.0f, 216.0f / 255.0f, 1.0f};
812 }
◆ ToIColor()
static constexpr uint32_t impeller::Color::ToIColor |
( |
Color |
color | ) |
|
|
inlinestaticconstexpr |
Convert this color to a 32-bit representation.
Definition at line 161 of file color.h.
161 {
162 return (((std::lround(
color.alpha * 255.0f) & 0xff) << 24) |
163 ((std::lround(
color.red * 255.0f) & 0xff) << 16) |
164 ((std::lround(
color.green * 255.0f) & 0xff) << 8) |
165 ((std::lround(
color.blue * 255.0f) & 0xff) << 0)) &
166 0xFFFFFFFF;
167 }
◆ Tomato()
static constexpr Color impeller::Color::Tomato |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 814 of file color.h.
814 {
815 return {255.0f / 255.0f, 99.0f / 255.0f, 71.0f / 255.0f, 1.0f};
816 }
◆ ToR8G8B8A8()
constexpr std::array< uint8_t, 4 > impeller::Color::ToR8G8B8A8 |
( |
| ) |
const |
|
inlineconstexpr |
Convert to R8G8B8A8 representation.
- Returns
- constexpr std::array<u_int8, 4>
Definition at line 248 of file color.h.
248 {
249 uint8_t r = std::round(
red * 255.0f);
250 uint8_t g = std::round(
green * 255.0f);
251 uint8_t
b = std::round(
blue * 255.0f);
252 uint8_t
a = std::round(
alpha * 255.0f);
254 }
◆ Turquoise()
static constexpr Color impeller::Color::Turquoise |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 818 of file color.h.
818 {
819 return {64.0f / 255.0f, 224.0f / 255.0f, 208.0f / 255.0f, 1.0f};
820 }
◆ Unpremultiply()
constexpr Color impeller::Color::Unpremultiply |
( |
| ) |
const |
|
inlineconstexpr |
◆ Violet()
static constexpr Color impeller::Color::Violet |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 822 of file color.h.
822 {
823 return {238.0f / 255.0f, 130.0f / 255.0f, 238.0f / 255.0f, 1.0f};
824 }
◆ Wheat()
static constexpr Color impeller::Color::Wheat |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 826 of file color.h.
826 {
827 return {245.0f / 255.0f, 222.0f / 255.0f, 179.0f / 255.0f, 1.0f};
828 }
◆ White()
static constexpr Color impeller::Color::White |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 256 of file color.h.
256{ return {1.0f, 1.0f, 1.0f, 1.0f}; }
◆ Whitesmoke()
static constexpr Color impeller::Color::Whitesmoke |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 830 of file color.h.
830 {
831 return {245.0f / 255.0f, 245.0f / 255.0f, 245.0f / 255.0f, 1.0f};
832 }
◆ WhiteTransparent()
static constexpr Color impeller::Color::WhiteTransparent |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 260 of file color.h.
260{ return {1.0f, 1.0f, 1.0f, 0.0f}; }
◆ WithAlpha()
constexpr Color impeller::Color::WithAlpha |
( |
Scalar |
new_alpha | ) |
const |
|
inlineconstexpr |
◆ Yellow()
static constexpr Color impeller::Color::Yellow |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 834 of file color.h.
834 {
835 return {255.0f / 255.0f, 255.0f / 255.0f, 0.0f / 255.0f, 1.0f};
836 }
◆ YellowGreen()
static constexpr Color impeller::Color::YellowGreen |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 838 of file color.h.
838 {
839 return {154.0f / 255.0f, 205.0f / 255.0f, 50.0f / 255.0f, 1.0f};
840 }
◆ alpha
Scalar impeller::Color::alpha = 0.0 |
The alpha component of the color (0 to 1)
Definition at line 143 of file color.h.
◆ blue
Scalar impeller::Color::blue = 0.0 |
The blue color component (0 to 1)
Definition at line 138 of file color.h.
◆ green
Scalar impeller::Color::green = 0.0 |
The green color component (0 to 1)
Definition at line 133 of file color.h.
◆ red
Scalar impeller::Color::red = 0.0 |
The red color component (0 to 1)
Definition at line 128 of file color.h.
The documentation for this struct was generated from the following files: