Exemplo n.º 1
0
        public XYZColor ToXYZ(LChuvColor color)
        {
            if (color == null)
            {
                throw new ArgumentNullException("color");
            }

            // conversion to Luv
            var      luvConverter = new LChuvToLuvConverter();
            LuvColor labColor     = luvConverter.Convert(color);

            // conversion to XYZ (incl. adaptation)
            XYZColor result = ToXYZ(labColor);

            return(result);
        }
Exemplo n.º 2
0
        public LuvColor ToLuv(LChuvColor color)
        {
            if (color == null)
            {
                throw new ArgumentNullException("color");
            }

            // conversion (perserving white point)
            var      converter = new LChuvToLuvConverter();
            LuvColor unadapted = converter.Convert(color);

            if (!IsChromaticAdaptationPerformed)
            {
                return(unadapted);
            }

            // adaptation to target luv white point (LuvWhitePoint)
            LuvColor adapted = Adapt(unadapted);

            return(adapted);
        }