LinearGradientData.h 649 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2023, MacDue <macdue@dueutil.tech>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Span.h>
  8. #include <AK/Vector.h>
  9. #include <LibGfx/Color.h>
  10. #include <LibGfx/Gradients.h>
  11. #include <LibWeb/Forward.h>
  12. namespace Web::Painting {
  13. using ColorStopList = Vector<Gfx::ColorStop, 4>;
  14. struct ColorStopData {
  15. ColorStopList list;
  16. Optional<float> repeat_length;
  17. };
  18. struct LinearGradientData {
  19. float gradient_angle;
  20. ColorStopData color_stops;
  21. };
  22. struct ConicGradientData {
  23. float start_angle;
  24. ColorStopData color_stops;
  25. };
  26. struct RadialGradientData {
  27. ColorStopData color_stops;
  28. };
  29. }