guardia-messenger/node_modules/react-native/ReactCommon/react/renderer/graphics/fromRawValueShared.h
DESKTOP-TKLFCPRython f29f525c77 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

51 lines
1.6 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <react/debug/react_native_expect.h>
#include <react/renderer/core/RawValue.h>
#include <react/renderer/graphics/Color.h>
#include <react/utils/ContextContainer.h>
#pragma once
namespace facebook::react {
using parsePlatformColorFn =
SharedColor (*)(const ContextContainer&, int32_t, const RawValue&);
inline void fromRawValueShared(
const ContextContainer& contextContainer,
int32_t surfaceId,
const RawValue& value,
SharedColor& result,
parsePlatformColorFn parsePlatformColor) {
ColorComponents colorComponents = {0, 0, 0, 0};
if (value.hasType<int>()) {
auto argb = (int64_t)value;
auto ratio = 255.f;
colorComponents.alpha = ((argb >> 24) & 0xFF) / ratio;
colorComponents.red = ((argb >> 16) & 0xFF) / ratio;
colorComponents.green = ((argb >> 8) & 0xFF) / ratio;
colorComponents.blue = (argb & 0xFF) / ratio;
result = colorFromComponents(colorComponents);
} else if (value.hasType<std::vector<float>>()) {
auto items = (std::vector<float>)value;
auto length = items.size();
react_native_expect(length == 3 || length == 4);
colorComponents.red = items.at(0);
colorComponents.green = items.at(1);
colorComponents.blue = items.at(2);
colorComponents.alpha = length == 4 ? items.at(3) : 1.0f;
result = colorFromComponents(colorComponents);
} else {
result = parsePlatformColor(contextContainer, surfaceId, value);
}
}
} // namespace facebook::react