Class Color
Hierarchy
- Cell<V>
- Color (View Summary)
Accessors
a
Returns this extends WritableBrand ? Writable<Num> : Num
b
Returns this extends WritableBrand ? Writable<Num> : Num
css
Returns Cell<string>
g
Returns this extends WritableBrand ? Writable<Num> : Num
luminance
Returns Num
r
Returns this extends WritableBrand ? Writable<Num> : Num
Methods
add
Parameters
- b: Val<V>
Returns this
derive
Parameters
- this: Cell<V>
- fn: (v: V) => V
Returns this
lens
Endomorphic lens. A 2-arg
bwd(view, current)consults the current source; a 1-argbwd(view)reconstructs it from the view alone.Parameters
- this: Cell<V>
- fwd: (v: V) => V
- bwd: (target: V, current: V) => V
Returns this
lerp
merge
peek
Returns V
scale
Parameters
- k: Val<number>
Returns this
sub
Parameters
- b: Val<V>
Returns this
through
to
Staticcoerce
Staticderive
Staticis
Staticlens
- lens<C extends AnyCellCtor, P>(
this: C,
parent: Read<P>,
fwd: (v: P) => Inner<InstanceType<C>>,
bwd: (target: Inner<InstanceType<C>>, v: P) => P,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[]>(
this: C,
parents: P,
fwd: (vals: ReadValues<P>) => Inner<InstanceType<C>>,
bwd: (
target: Inner<InstanceType<C>>,
vals: ReadValues<P>,
) => BackUpdates<ReadValuesOrSkip<P>>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
Parameters
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P, Cm>(
this: C,
parent: Read<P>,
spec: StatefulLensSpec1<P, Inner<InstanceType<C>>, Cm>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P
- Cm
Returns Writable<InstanceType<C>>
- lens<C extends AnyCellCtor, P extends readonly Read<unknown>[], Cm>(
this: C,
parents: P,
spec: StatefulLensSpec<ReadValues<P>, Inner<InstanceType<C>>, Cm>,
): Writable<InstanceType<C>>Writable lens.
Cls.lens(parent, fwd, bwd)for one input,Cls.lens(parents, fwd, bwd)for N; a 2-argbwdreads the source, a 1-argbwdreconstructs it.Cls.lens(parent(s), spec)builds a complement-carrying lens from{ init, step, fwd, bwd }.Type Parameters
- C extends AnyCellCtor
- P extends readonly Read<unknown>[]
- Cm
Returns Writable<InstanceType<C>>
Staticpin
Properties
Readonly_t
name
Optional debug label (cell(0, { name })); used by errors and graph dumps.
Read-only same-type view: the RO dual of the endo
.lens. For a cross-type view use the typed staticTarget.derive(src, fn).