Skip to main content

Color

caution

This service is experimental and may change in the future.

Senses RGB colors

import { Color } from "@devicescript/core"

const color = new Color()

Registers

reading

Detected color in the RGB color space.

  • type: Register<any[]> (packing format u0.16 u0.16 u0.16)

  • track incoming values

import { Color } from "@devicescript/core"

const color = new Color()
// ...
color.reading.subscribe(async (value) => {
...
})
note

write and read will block until a server is bound to the client.