ColorValue should encapsulate colorvalue. It should include reference to color definition.
We should use ColorValue everywhere where we work with colorvalue.
Base class ColorValue should be abstract, it only provides to get colordef. Its subclass AdditiveColorValue should be used as parent class for colorvalues which are additive.
A concrete class, let's say SimpeColorValue or IntegerColorValue should keep track of value as an integer amount and implement arithmetic operators like + - < ==.
We convert from satoshi amounts to colorvalues in ColorDefinition.run_kernel. We convert from colorvalues to satoshi amounts in ColorDefinition.compose_tx_spec.
Thus they are largely opaque.
ColorDataStore's functions should return data in ColorValue format.
ColorValue should encapsulate colorvalue. It should include reference to color definition.
We should use ColorValue everywhere where we work with colorvalue.
Base class ColorValue should be abstract, it only provides to get colordef. Its subclass AdditiveColorValue should be used as parent class for colorvalues which are additive.
A concrete class, let's say SimpeColorValue or IntegerColorValue should keep track of value as an integer amount and implement arithmetic operators like + - < ==.
We convert from satoshi amounts to colorvalues in ColorDefinition.run_kernel. We convert from colorvalues to satoshi amounts in ColorDefinition.compose_tx_spec.
Thus they are largely opaque.
ColorDataStore's functions should return data in ColorValue format.