importPreset throws errors on color

This issue has been tracked since 2023-03-02.

Using tweakpane 3.1.5

I'm seeing an error whenever I try to export & import a color variable. I thought it may be due to the formatting, but {rgba} objects and "rgba()" strings also report similar but different errors.

TypeError: value.getComponents is not a function 
    at colorToHexRgbaString

TypeError: value.toRgbaObject is not a function
    at writeRgbColorObject
import { Pane } from 'tweakpane';

var state = { color: "#ffffff" }

var p = new Pane()
p.addInput(state, "color")

p.importPreset(p.exportPreset()) // TypeError: value.getComponents is not a function at colorToHexRgbaString
cocopon wrote this answer on 2023-03-13

My mistake... there was a problem reading the preset values. Fixed in the latest version 3.1.6.

chrsmlls333 wrote this answer on 2023-03-13

Thank you for the quick fix!

More Details About Repo
Owner Name cocopon
Repo Name tweakpane
Full Name cocopon/tweakpane
Language TypeScript
Created Date 2016-05-10
Updated Date 2023-03-17
Star Count 2603
Watcher Count 19
Fork Count 71
Issue Count 11

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date