core.bones.color
¶
Module Contents¶
Classes¶
ColorBone is a custom bone class for storing color values in the ViUR framework. |
- class core.bones.color.ColorBone(*, mode='rgb', **kwargs)¶
Bases:
viur.core.bones.base.BaseBone
ColorBone is a custom bone class for storing color values in the ViUR framework. It inherits from the BaseBone class in the viur.core.bones.base module.
- Parameters:
type – A string representing the bone type, set to “color”.
mode – A string specifying the color mode, either “rgb” or “rgba”. Default is “rgb”.
**kwargs – Additional keyword arguments passed to the BaseBone constructor.
Initializes a new Bone.
- type = 'color'¶
- singleValueFromClient(value, skel, bone_name, client_data)¶
Load a single value from a client
- Parameters:
value – The single value which should be loaded.
skel – The SkeletonInstance where the value should be loaded into.
bone_name – The bone name of this bone in the SkeletonInstance.
client_data – The data taken from the client, a dictionary with usually bone names as key
- Returns:
A tuple. If the value is valid, the first element is the parsed value and the second is None. If the value is invalid or not parseable, the first element is a empty value and the second a list of ReadFromClientError.