<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKSpriteNode/init(color:size:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKSpriteNode(im)initWithColor:size:"
  },
  "title" : "init(color:size:)"
}
-->

# init(color:size:)

Initializes a single-color sprite node.

```
convenience init(color: NSColor, size: CGSize)
```

## Parameters

`color`

The color for the resulting sprite node.

`size`

The size of the sprite node in points.

## Return Value

A newly initialized sprite node.

## Discussion

Although textured nodes are the most common way to use the [`SKSpriteNode`](/documentation/SpriteKit/SKSpriteNode) class, you can also create sprite nodes without a texture. The behavior of the class changes when the node lacks a texture:

- The sprite node that is returned from this method has its [`texture`](/documentation/SpriteKit/SKSpriteNode/texture) property set to `nil`.
- There is no texture to stretch, so the [`centerRect`](/documentation/SpriteKit/SKSpriteNode/centerRect) parameter is ignored.
- There is no colorization step; the [`color`](/documentation/SpriteKit/SKSpriteNode/color) property is used as the sprite’s color.
- The sprite node’s [`alpha`](/documentation/SpriteKit/SKNode/alpha) component is used to determine how it is blended into the buffer.

Listing 1 shows how to create a red sprite node `100 x 100` points in size.

Listing 1. Creating a non-textured sprite node

```swift
let node = SKSpriteNode(color: .red,
                        size: CGSize(width: 100, height: 100))
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)