7#include "xfa/fxfa/parser/cxfa_color.h"
9#include "core/fxcrt/fx_extension.h"
10#include "fxjs/xfa/cjx_node.h"
11#include "xfa/fgas/graphics/cfgas_gecolor.h"
12#include "xfa/fxfa/parser/cxfa_document.h"
32 static constexpr FX_ARGB kDefaultValue = 0xff000000;
36 pdfium::span<
const wchar_t> str = view.span();
38 while (cc < str.size() && FXSYS_iswspace(str[cc])) {
42 if (cc >= str.size()) {
49 while (cc < str.size()) {
50 if (str[cc] ==
',' || !FXSYS_IsDecimalDigit(str[cc]))
53 r = r * 10 + str[cc] -
'0';
56 if (cc < str.size() && str[cc] ==
',') {
58 while (cc < str.size() && FXSYS_iswspace(str[cc])) {
62 while (cc < str.size()) {
63 if (str[cc] ==
',' || !FXSYS_IsDecimalDigit(str[cc]))
66 g = g * 10 + str[cc] -
'0';
69 if (cc < str.size() && str[cc] ==
',') {
71 while (cc < str.size() && FXSYS_iswspace(str[cc])) {
75 while (cc < str.size()) {
76 if (str[cc] ==
',' || !FXSYS_IsDecimalDigit(str[cc]))
79 b = b * 10 + str[cc] -
'0';
90 {XFA_XDPPACKET::kTemplate, XFA_XDPPACKET::kForm},
95 cppgc::MakeGarbageCollected<CJX_Node>(
96 doc->GetHeap()->GetAllocationHandle(),
103 JSObject()->TryCData(XFA_Attribute::Value,
false);
109 JSObject()->TryCData(XFA_Attribute::Value,
false);
110 return val.has_value() ?
StringToFXARGB(val->AsStringView()
) : defaultValue;
static ByteString ColorToString(FX_ARGB argb)
FX_ARGB GetValueOrDefault(FX_ARGB defaultValue) const
static FX_ARGB StringToFXARGB(WideStringView view)
void SetValue(FX_ARGB color)
static WideString FromASCII(ByteStringView str)
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
fxcrt::WideStringView WideStringView
fxcrt::WideString WideString