Skip to content

NSShadow() constructor ​

The NSShadow() constructor creates a text shadow.

Syntax ​

new NSShadow()

Parameters ​

None.

Return value ​

The new NSShadow: shadowOffset is (0, 0), shadowBlurRadius is 0, and shadowColor is black at one-third opacity.

Exceptions ​

It cannot be subclassed; class X extends NSShadow {} throws TypeError on new X(). See Native classes.

Examples ​

js
const shadow = new NSShadow();
console.log(shadow.shadowOffset.width, shadow.shadowOffset.height, shadow.shadowBlurRadius);

Result: The console prints 0 0 0.

Corresponding iOS API ​

[[NSShadow alloc] init].

See also ​