Files
ladybird/Libraries/LibWeb/Painting/GradientData.h
Callum Law 9db607b1a7 LibWeb: Use generic <color-interpolation-method> parsing for gradients
See previous commit for details

We now support parsing of `display-p3-linear` (although it just falls
back to using Oklab since Skia doesn't support it)
2026-03-18 13:21:57 +00:00

43 lines
1000 B
C++

/*
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Span.h>
#include <AK/Vector.h>
#include <LibGfx/Gradients.h>
#include <LibWeb/CSS/StyleValues/ColorInterpolationMethodStyleValue.h>
#include <LibWeb/Forward.h>
namespace Web::Painting {
using ColorStopList = Vector<Gfx::ColorStop, 4>;
struct ColorStopData {
ColorStopList list;
Optional<float> repeat_length;
bool repeating { false };
};
struct LinearGradientData {
float gradient_angle;
ColorStopData color_stops;
CSS::ColorInterpolationMethodStyleValue::ColorInterpolationMethod interpolation_method;
};
struct ConicGradientData {
float start_angle;
ColorStopData color_stops;
CSS::ColorInterpolationMethodStyleValue::ColorInterpolationMethod interpolation_method;
};
struct RadialGradientData {
ColorStopData color_stops;
CSS::ColorInterpolationMethodStyleValue::ColorInterpolationMethod interpolation_method;
};
}