/
githubmirror
/
react-native
Обзор
Документация
Войти
/
githubmirror
/
react-native
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/rn-tester/NativeComponentExample/ios/RNTLegacyView.mm
34 строки
818 B
generatedunixname89002005287564
Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53591)
04 сен 2025, 13:13
04 сен 2025, 13:13
4553f87
Код
Авторство
О чём код?
/* * 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. */ #import "RNTLegacyView.h" @implementation RNTLegacyView - (void)setBackgroundColor:(UIColor *)backgroundColor { super.backgroundColor = backgroundColor; [self emitEvent]; } - (void)emitEvent { if (self.onColorChanged == nullptr) { return; } CGFloat hue = 0.0; CGFloat saturation = 0.0; CGFloat brightness = 0.0; CGFloat alpha = 0.0; [self.backgroundColor getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha]; self.onColorChanged(@{ @"backgroundColor" : @{@"hue" : @(hue), @"saturation" : @(saturation), @"brightness" : @(brightness), @"alpha" : @(alpha)} }); } @end