Skip to content

Commit 0e3a210

Browse files
mdvaccameta-codesync[bot]
authored andcommitted
Add comprehensive KDoc documentation to FilterHelper (facebook#54350)
Summary: Pull Request resolved: facebook#54350 Added comprehensive KDoc documentation to the FilterHelper object and its primary public method for parsing and applying CSS filter effects on Android S+ (API 31+). changelog: [internal] internal Reviewed By: lenaic Differential Revision: D85926889 fbshipit-source-id: e20bb0697753e710d66acc3ef4078ab009d6dc5d
1 parent b8f9d98 commit 0e3a210

File tree

1 file changed

+16
-0
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager

1 file changed

+16
-0
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FilterHelper.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,25 @@ import com.facebook.react.uimanager.PixelUtil.dpToPx
2121
import kotlin.math.cos
2222
import kotlin.math.sin
2323

24+
/**
25+
* Helper object for parsing and applying CSS filter effects on Android S+ (API 31+).
26+
*
27+
* This object provides utilities to convert CSS filter arrays into Android [RenderEffect] chains
28+
* and [ColorMatrixColorFilter] objects. Supports filters like blur, brightness, contrast,
29+
* grayscale, sepia, saturate, hue-rotate, invert, opacity, and drop-shadow.
30+
*
31+
* @see <a href="https://www.w3.org/TR/filter-effects-1/">CSS Filter Effects Module Level 1</a>
32+
*/
2433
@TargetApi(31)
2534
internal object FilterHelper {
2635

36+
/**
37+
* Parses a ReadableArray of CSS filter definitions into a chained [RenderEffect].
38+
*
39+
* @param filters The array of filter definitions, or null
40+
* @return A chained RenderEffect representing all filters, or null if no filters provided
41+
* @throws IllegalArgumentException if an invalid filter name is encountered
42+
*/
2743
@JvmStatic
2844
fun parseFilters(filters: ReadableArray?): RenderEffect? {
2945
filters ?: return null

0 commit comments

Comments
 (0)