---
title: CIColorKernel
framework: coreimage
role: symbol
role_heading: Class
path: coreimage/cicolorkernel
---

# CIColorKernel

A GPU-based image-processing routine that processes only the color information in images, used to create custom Core Image filters.

## Declaration

```swift
class CIColorKernel
```

## Overview

Overview The kernel language routine for a color kernel has the following characteristics: Its return type is vec4 (Core Image Kernel Language) or float4 (Metal Shading Language); that is, it returns a pixel color for the output image. It may use zero or more input images. Each input image is represented by a parameter of type __sample (Core Image Kernel Language) or sample_t (Metal Shading Language), which can be treated as a single pixel color of type vec4 (Core Image Kernel Language) or float4 (Metal Shading Language);. A color kernel routine receives as input single-pixel colors (one sampled from each input image) and computes a final pixel color (output using the return keyword). For example, the Metal Shading Language source below implements a filter that passes through its input image unchanged. #include <CoreImage/CoreImage.h>   extern "C" {     namespace coreimage {         float4 do_nothing(sample_t s) {             return s;         }     } } The equivalent code in Core Image Kernel Language is: kernel vec4 do_nothing(__sample s) {     return s.rgba; } The Core Image Kernel Language is a dialect of the OpenGL Shading Language. See Core Image Kernel Language Reference and Core Image Programming Guide for more details.

## Topics

### Creating a Kernel

- [init(source:)](coreimage/cicolorkernel/init(source:).md)

### Applying a Kernel to Filter an Image

- [apply(extent:arguments:)](coreimage/cicolorkernel/apply(extent:arguments:).md)

## Relationships

### Inherits From

- [CIKernel](coreimage/cikernel.md)

### Inherited By

- [CIBlendKernel](coreimage/ciblendkernel.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Custom Filters

- [Writing Custom Kernels](coreimage/writing-custom-kernels.md)
- [CIKernel](coreimage/cikernel.md)
- [CIWarpKernel](coreimage/ciwarpkernel.md)
- [CIBlendKernel](coreimage/ciblendkernel.md)
- [CISampler](coreimage/cisampler.md)
- [CIFilterShape](coreimage/cifiltershape.md)
- [CIFormat](coreimage/ciformat.md)
