OH_ArkUI_SetForceDarkConfig

Function OH_ArkUI_SetForceDarkConfig 

Source
pub unsafe extern "C" fn OH_ArkUI_SetForceDarkConfig(
    uiContext: ArkUI_ContextHandle,
    forceDark: bool,
    nodeType: ArkUI_NodeType,
    colorInvertFunc: Option<unsafe extern "C" fn(color: u32) -> u32>,
) -> i32
Available on crate features api-12 and api-20 only.
Expand description

Sets the inverse color algorithm for components and instances.

§Arguments

  • uiContext - Indicates the context in which the inverse color feature should take effect. If the value is null, the feature applies to the entire application process.

  • forceDark - Indicates whether the inverse color feature is enabled.

  • nodeType - Indicates the component type for which to enable the inverse color feature. If the value is ARKUI_NODE_UNDEFINED, enabling the feature for all components.

  • colorInvertFunc - Indicates the user-defined inverse color algorithm.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_CAPI_INIT_ERROR] if CAPI init error. Returns [ARKUI_ERROR_CODE_FORCE_DARK_CONFIG_INVALID] if force dark config is invalid.

Available since API-level: 20