Beispiel #1
0
 public void SetColorAt(int index, Vector3 colorMask)
 {
     colorMask = Utils.ColorMaskNormalize(colorMask);
     if (colorMask != _colorsMasks[index])
     {
         _colorsMasks[index] = colorMask;
         ColorListChanged?.Invoke(this, index);
     }
 }
Beispiel #2
0
        public void SetColors(uint[] copyFrom)
        {
            if (copyFrom.Length != _colorsMasks.Length)
            {
                Log.Error($"SetColors(uint[]) got unexpected array size={copyFrom.Length.ToString()}");
                // continue execution
            }

            for (int i = 0; i < Math.Min(_colorsMasks.Length, copyFrom.Length); i++)
            {
                _colorsMasks[i] = ColorExtensions.UnpackHSVFromUint(copyFrom[i]);
            }

            ColorListChanged?.Invoke(this, null);
        }
Beispiel #3
0
        public void SetColors(List <Vector3> copyFrom)
        {
            if (copyFrom.Count != _colorsMasks.Length)
            {
                Log.Error($"SetColors(List<Vector3>) got unexpected list size={copyFrom.Count.ToString()}");
                // continue execution
            }

            for (int i = 0; i < Math.Min(_colorsMasks.Length, copyFrom.Count); i++)
            {
                // Normalize color because it can differ to the palette after being painted and converted like this, causing weird issues
                _colorsMasks[i] = Utils.ColorMaskNormalize(copyFrom[i]);
            }

            ColorListChanged?.Invoke(this, null);
        }