diff --git a/js-api-spec/setup.ts b/js-api-spec/setup.ts index 9f5bd41956..8eccfc2758 100644 --- a/js-api-spec/setup.ts +++ b/js-api-spec/setup.ts @@ -55,6 +55,29 @@ declare global { */ toEqualWithHash(value: immutable.ValueObject): T; + /** + * Matches a number that is equal to `value` using `SassNumber.equals()`. + */ + toFuzzyEqual(value: number): T; + + /** + * Matches a number that is equal to `value` to 5 decimal places. + */ + toLooselyEqual(value: number): T; + + /** + * Matches a SassColor where each channel in `value` is equal to 5 decimal + * places. + */ + toLooselyEqualColor(value: sass.SassColor): T; + + /** + * Matches an array against an Immutable List. Non-numeric values are + * exactly matched, and numbers are fuzzy matched using + * `SassNumber.equals()`. + */ + toFuzzyEqualList(value: unknown[]): T; + /** * Matches a value that's `null` or `undefined`. */ @@ -312,6 +335,99 @@ const toEqualIgnoringWhitespace = (received: unknown, actual: string) => { }; }; +const toFuzzyEqual = (received: unknown, actual: number) => { + if (typeof received !== 'number') { + throw new Error('Received value must be a number'); + } + return { + message: `expected ${received} to fuzzy equal ${actual}`, + pass: new sass.SassNumber(received).equals(new sass.SassNumber(actual)), + }; +}; + +const toLooselyEqual = (received: unknown, actual: number) => { + if (typeof received !== 'number') { + throw new Error('Received value must be a number'); + } + return { + message: `expected ${received} to loosely equal ${actual} to 5 decimal places`, + pass: Math.round((received * 10) ^ 5) === Math.round((actual * 10) ^ 5), + }; +}; + +// The max distance two Sass numbers can be from each another before they're +// considered different (2 decimals). +// +// Uses ** instead of Math.pow() for constant folding. +// TODO: Ideally this should be more precise, but ColorJS does not always match. +const epsilon = 10 ** -2; + +const toLooselyEqualColor = (received: unknown, actual: sass.SassColor) => { + function isSassColor(item: unknown): item is sass.SassColor { + return !!(item as sass.SassColor).assertColor(); + } + if (!isSassColor(received)) { + throw new Error('Received value must be a SassColor'); + } + const unequalIndices: number[] = []; + received.channelsOrNull.forEach((channel: number | null, index: number) => { + const actualChannel = actual.channelsOrNull.get(index); + if (channel === null) { + if (actualChannel !== null) unequalIndices.push(index); + } else if ( + actualChannel === null || + Math.abs(channel - actualChannel) > epsilon + ) { + unequalIndices.push(index); + } + }); + const plural = unequalIndices.length !== 1; + const indexMessage = `${plural ? 'indices' : 'index'} ${unequalIndices.join( + ',' + )}`; + return { + message: `expected ${received} to loosely equal ${actual}, but channels at ${indexMessage} differ`, + pass: unequalIndices.length === 0, + }; +}; + +const toFuzzyEqualList = (received: unknown, actual: unknown[]) => { + if (!immutable.List.isList(received)) { + throw new Error('Received value must be an Immutuable List'); + } + if (received.count() !== actual.length) { + return { + pass: false, + message: `expected List to have length ${ + actual.length + }, received ${received.count()}`, + }; + } + let pass = true; + let message = ''; + received.forEach((receivedItem, index) => { + const actualItem = actual[index]; + if (!pass) return; + if (typeof receivedItem !== typeof actualItem) { + pass = false; + message = `expected ${receivedItem} to be the same type as ${actual[index]} at index ${index}`; + } + if (typeof receivedItem === 'number' && typeof actualItem === 'number') { + pass = new sass.SassNumber(receivedItem).equals( + new sass.SassNumber(actualItem) + ); + message = `expected ${receivedItem} to fuzzy equal ${actual[index]} at index ${index}`; + } else { + pass = receivedItem === actualItem; + message = `expected non-numeric ${receivedItem} to exactly equal ${actual[index]} at index ${index}`; + } + }); + return { + message, + pass, + }; +}; + // Add custom matchers to Jasmine beforeAll(() => { jasmine.addMatchers({ @@ -330,6 +446,18 @@ beforeAll(() => { toEqualIgnoringWhitespace: () => ({ compare: toEqualIgnoringWhitespace, }), + toFuzzyEqual: () => ({ + compare: toFuzzyEqual, + }), + toLooselyEqual: () => ({ + compare: toLooselyEqual, + }), + toLooselyEqualColor: () => ({ + compare: toLooselyEqualColor, + }), + toFuzzyEqualList: () => ({ + compare: toFuzzyEqualList, + }), }); jasmine.addAsyncMatchers({ toThrowSassException: () => ({ diff --git a/js-api-spec/value/color.test.ts b/js-api-spec/value/color.test.ts deleted file mode 100644 index c816c67c7c..0000000000 --- a/js-api-spec/value/color.test.ts +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright 2021 Google Inc. Use of this source code is governed by an -// MIT-style license that can be found in the LICENSE file or at -// https://opensource.org/licenses/MIT. - -import {Value, SassColor} from 'sass'; - -/** A utility function for creating an RGB color. */ -function rgb( - red: number, - green: number, - blue: number, - alpha?: number -): SassColor { - return new SassColor({red, green, blue, alpha}); -} - -/** A utility function for creating an HSL color. */ -function hsl( - hue: number, - saturation: number, - lightness: number, - alpha?: number -): SassColor { - return new SassColor({hue, saturation, lightness, alpha}); -} - -/** A utility function for creating an HWB color. */ -function hwb( - hue: number, - whiteness: number, - blackness: number, - alpha?: number -): SassColor { - return new SassColor({hue, whiteness, blackness, alpha}); -} - -describe('SassColor', () => { - describe('construction', () => { - describe('type', () => { - let color: SassColor; - beforeEach(() => { - color = rgb(18, 52, 86); - }); - - it('is a value', () => { - expect(color).toBeInstanceOf(Value); - }); - - it('is a color', () => { - expect(color).toBeInstanceOf(SassColor); - expect(color.assertColor()).toBe(color); - }); - - it("isn't any other type", () => { - expect(() => color.assertBoolean()).toThrow(); - expect(() => color.assertCalculation()).toThrow(); - expect(() => color.assertFunction()).toThrow(); - expect(() => color.assertMap()).toThrow(); - expect(color.tryMap()).toBe(null); - expect(() => color.assertMixin()).toThrow(); - expect(() => color.assertNumber()).toThrow(); - expect(() => color.assertString()).toThrow(); - }); - }); - - describe('rgb()', () => { - it('allows valid values', () => { - expect(() => rgb(0, 0, 0, 0)).not.toThrow(); - expect(() => rgb(255, 255, 255, 1)).not.toThrow(); - }); - - it('disallows invalid values', () => { - expect(() => rgb(-1, 0, 0, 0)).toThrow(); - expect(() => rgb(0, -1, 0, 0)).toThrow(); - expect(() => rgb(0, 0, -1, 0)).toThrow(); - expect(() => rgb(0, 0, 0, -0.1)).toThrow(); - expect(() => rgb(256, 0, 0, 0)).toThrow(); - expect(() => rgb(0, 256, 0, 0)).toThrow(); - expect(() => rgb(0, 0, 256, 0)).toThrow(); - expect(() => rgb(0, 0, 0, 1.1)).toThrow(); - }); - - it('rounds channels to the nearest integer', () => { - expect(rgb(0.1, 50.4, 90.3)).toEqualWithHash(rgb(0, 50, 90)); - expect(rgb(-0.1, 50.5, 90.7)).toEqualWithHash(rgb(0, 51, 91)); - }); - }); - - describe('hsl()', () => { - it('allows valid values', () => { - expect(() => hsl(0, 0, 0, 0)).not.toThrow(); - expect(() => hsl(4320, 100, 100, 1)).not.toThrow(); - }); - - it('disallows invalid values', () => { - expect(() => hsl(0, -0.1, 0, 0)).toThrow(); - expect(() => hsl(0, 0, -0.1, 0)).toThrow(); - expect(() => hsl(0, 0, 0, -0.1)).toThrow(); - expect(() => hsl(0, 100.1, 0, 0)).toThrow(); - expect(() => hsl(0, 0, 100.1, 0)).toThrow(); - expect(() => hsl(0, 0, 0, 1.1)).toThrow(); - }); - }); - - describe('hwb()', () => { - it('allows valid values', () => { - expect(() => hwb(0, 0, 0, 0)).not.toThrow(); - expect(() => hwb(4320, 100, 100, 1)).not.toThrow(); - }); - - it('disallows invalid values', () => { - expect(() => hwb(0, -0.1, 0, 0)).toThrow(); - expect(() => hwb(0, 0, -0.1, 0)).toThrow(); - expect(() => hwb(0, 0, 0, -0.1)).toThrow(); - expect(() => hwb(0, 100.1, 0, 0)).toThrow(); - expect(() => hwb(0, 0, 100.1, 0)).toThrow(); - expect(() => hwb(0, 0, 0, 1.1)).toThrow(); - }); - }); - }); - - describe('an RGB color', () => { - let color: SassColor; - beforeEach(() => { - color = rgb(18, 52, 86); - }); - - it('has RGB channels', () => { - expect(color.red).toBe(18); - expect(color.green).toBe(52); - expect(color.blue).toBe(86); - }); - - it('has HSL channels', () => { - expect(color.hue).toBe(210); - expect(color.saturation).toBe(65.3846153846154); - expect(color.lightness).toBe(20.392156862745097); - }); - - it('has HWB channels', () => { - expect(color.hue).toBe(210); - expect(color.whiteness).toBe(7.0588235294117645); - expect(color.blackness).toBe(66.27450980392157); - }); - - it('has an alpha channel', () => { - expect(color.alpha).toBe(1); - }); - - it('equals the same color', () => { - expect(color).toEqualWithHash(rgb(18, 52, 86)); - expect(color).toEqualWithHash( - hsl(210, 65.3846153846154, 20.392156862745097) - ); - expect(color).toEqualWithHash( - hwb(210, 7.0588235294117645, 66.27450980392157) - ); - }); - }); - - describe('an HSL color', () => { - let color: SassColor; - beforeEach(() => { - color = hsl(120, 42, 42); - }); - - it('has RGB channels', () => { - expect(color.red).toBe(62); - expect(color.green).toBe(152); - expect(color.blue).toBe(62); - }); - - it('has HSL channels', () => { - expect(color.hue).toBe(120); - expect(color.saturation).toBe(42); - expect(color.lightness).toBe(42); - }); - - it('has HWB channels', () => { - expect(color.hue).toBe(120); - expect(color.whiteness).toBe(24.313725490196077); - expect(color.blackness).toBe(40.3921568627451); - }); - - it('has an alpha channel', () => { - expect(color.alpha).toBe(1); - }); - - it('equals the same color', () => { - expect(color).toEqualWithHash(rgb(62, 152, 62)); - expect(color).toEqualWithHash(hsl(120, 42, 42)); - expect(color).toEqualWithHash( - hwb(120, 24.313725490196077, 40.3921568627451) - ); - }); - - it('allows negative hue', () => { - expect(hsl(-240, 42, 42).hue).toBe(120); - expect(hsl(-240, 42, 42)).toEqualWithHash(color); - }); - }); - - describe('an HWB color', () => { - let color: SassColor; - beforeEach(() => { - color = hwb(120, 42, 42); - }); - - it('has RGB channels', () => { - expect(color.red).toBe(107); - expect(color.green).toBe(148); - expect(color.blue).toBe(107); - }); - - it('has HSL channels', () => { - expect(color.hue).toBe(120); - expect(color.saturation).toBe(16.078431372549026); - expect(color.lightness).toBe(50); - }); - - it('has HWB channels', () => { - expect(color.hue).toBe(120); - expect(color.whiteness).toBe(41.96078431372549); - expect(color.blackness).toBe(41.96078431372548); - }); - - it('has an alpha channel', () => { - expect(color.alpha).toBe(1); - }); - - it('equals the same color', () => { - expect(color).toEqualWithHash(rgb(107, 148, 107)); - expect(color).toEqualWithHash(hsl(120, 16.078431372549026, 50)); - expect(color).toEqualWithHash( - hwb(120, 41.96078431372549, 41.96078431372548) - ); - }); - - it('allows negative hue', () => { - expect(hwb(-240, 42, 42).hue).toBe(120); - expect(hwb(-240, 42, 42)).toEqualWithHash(color); - }); - }); - - describe('changing color values', () => { - let color: SassColor; - beforeEach(() => { - color = rgb(18, 52, 86); - }); - - describe('change() for RGB', () => { - it('changes RGB values', () => { - expect(color.change({red: 0})).toEqualWithHash(rgb(0, 52, 86)); - expect(color.change({green: 0})).toEqualWithHash(rgb(18, 0, 86)); - expect(color.change({blue: 0})).toEqualWithHash(rgb(18, 52, 0)); - expect(color.change({alpha: 0.5})).toEqualWithHash( - rgb(18, 52, 86, 0.5) - ); - expect( - color.change({red: 0, green: 0, blue: 0, alpha: 0.5}) - ).toEqualWithHash(rgb(0, 0, 0, 0.5)); - }); - - it('allows valid values', () => { - expect(color.change({red: 0}).red).toBe(0); - expect(color.change({red: 255}).red).toBe(255); - expect(color.change({green: 0}).green).toBe(0); - expect(color.change({green: 255}).green).toBe(255); - expect(color.change({blue: 0}).blue).toBe(0); - expect(color.change({blue: 255}).blue).toBe(255); - expect(color.change({alpha: 0}).alpha).toBe(0); - expect(color.change({alpha: 1}).alpha).toBe(1); - }); - - it('disallows invalid values', () => { - expect(() => color.change({red: -1})).toThrow(); - expect(() => color.change({red: 256})).toThrow(); - expect(() => color.change({green: -1})).toThrow(); - expect(() => color.change({green: 256})).toThrow(); - expect(() => color.change({blue: -1})).toThrow(); - expect(() => color.change({blue: 256})).toThrow(); - expect(() => color.change({alpha: -0.1})).toThrow(); - expect(() => color.change({alpha: 1.1})).toThrow(); - }); - - it('rounds channels to the nearest integer', () => { - expect( - color.change({red: 0.1, green: 50.4, blue: 90.3}) - ).toEqualWithHash(rgb(0, 50, 90)); - expect( - color.change({red: -0.1, green: 50.5, blue: 90.9}) - ).toEqualWithHash(rgb(0, 51, 91)); - }); - }); - - describe('change() for HSL', () => { - it('changes HSL values', () => { - expect(color.change({hue: 120})).toEqualWithHash( - hsl(120, 65.3846153846154, 20.392156862745097) - ); - expect(color.change({hue: -120})).toEqualWithHash( - hsl(240, 65.3846153846154, 20.392156862745097) - ); - expect(color.change({saturation: 42})).toEqualWithHash( - hsl(210, 42, 20.392156862745097) - ); - expect(color.change({lightness: 42})).toEqualWithHash( - hsl(210, 65.3846153846154, 42) - ); - expect(color.change({alpha: 0.5})).toEqualWithHash( - hsl(210, 65.3846153846154, 20.392156862745097, 0.5) - ); - expect( - color.change({ - hue: 120, - saturation: 42, - lightness: 42, - alpha: 0.5, - }) - ).toEqualWithHash(hsl(120, 42, 42, 0.5)); - }); - - it('allows valid values', () => { - expect(color.change({saturation: 0}).saturation).toBe(0); - expect(color.change({saturation: 100}).saturation).toBe(100); - expect(color.change({lightness: 0}).lightness).toBe(0); - expect(color.change({lightness: 100}).lightness).toBe(100); - expect(color.change({alpha: 0}).alpha).toBe(0); - expect(color.change({alpha: 1}).alpha).toBe(1); - }); - - it('disallows invalid values', () => { - expect(() => color.change({saturation: -0.1})).toThrow(); - expect(() => color.change({saturation: 100.1})).toThrow(); - expect(() => color.change({lightness: -0.1})).toThrow(); - expect(() => color.change({lightness: 100.1})).toThrow(); - expect(() => color.change({alpha: -0.1})).toThrow(); - expect(() => color.change({alpha: 1.1})).toThrow(); - }); - }); - - describe('change() for HWB', () => { - it('changes HWB values', () => { - expect(color.change({hue: 120})).toEqualWithHash( - hwb(120, 7.0588235294117645, 66.27450980392157) - ); - expect(color.change({hue: -120})).toEqualWithHash( - hwb(240, 7.0588235294117645, 66.27450980392157) - ); - expect(color.change({whiteness: 42})).toEqualWithHash( - hwb(210, 42, 66.27450980392157) - ); - expect(color.change({whiteness: 50})).toEqualWithHash( - hwb(210, 50, 66.27450980392157) - ); - expect(color.change({blackness: 42})).toEqualWithHash( - hwb(210, 7.0588235294117645, 42) - ); - expect(color.change({alpha: 0.5})).toEqualWithHash( - hwb(210, 7.0588235294117645, 66.27450980392157, 0.5) - ); - expect( - color.change({ - hue: 120, - whiteness: 42, - blackness: 42, - alpha: 0.5, - }) - ).toEqualWithHash(hwb(120, 42, 42, 0.5)); - }); - - it('allows valid values', () => { - expect(color.change({whiteness: 0}).whiteness).toBe(0); - expect(color.change({whiteness: 100}).whiteness).toBe(60.0); - expect(color.change({blackness: 0}).blackness).toBe(0); - expect(color.change({blackness: 100}).blackness).toBe( - 93.33333333333333 - ); - expect(color.change({alpha: 0}).alpha).toBe(0); - expect(color.change({alpha: 1}).alpha).toBe(1); - }); - - it('disallows invalid values', () => { - expect(() => color.change({whiteness: -0.1})).toThrow(); - expect(() => color.change({whiteness: 100.1})).toThrow(); - expect(() => color.change({blackness: -0.1})).toThrow(); - expect(() => color.change({blackness: 100.1})).toThrow(); - expect(() => color.change({alpha: -0.1})).toThrow(); - expect(() => color.change({alpha: 1.1})).toThrow(); - }); - }); - - describe('changeAlpha()', () => { - it('changes the alpha value', () => { - expect(color.change({alpha: 0.5})).toEqualWithHash( - rgb(18, 52, 86, 0.5) - ); - }); - - it('allows valid alphas', () => { - expect(color.change({alpha: 0}).alpha).toBe(0); - expect(color.change({alpha: 1}).alpha).toBe(1); - }); - - it('rejects invalid alphas', () => { - expect(() => color.change({alpha: -0.1})).toThrow(); - expect(() => color.change({alpha: 1.1})).toThrow(); - }); - }); - }); -}); diff --git a/js-api-spec/value/color/color-4-channels.test.ts b/js-api-spec/value/color/color-4-channels.test.ts new file mode 100644 index 0000000000..9bcdee6b9a --- /dev/null +++ b/js-api-spec/value/color/color-4-channels.test.ts @@ -0,0 +1,330 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +// General space-specific info and construction + +import {SassColor} from 'sass'; +import type {ChannelNameXyz, ColorSpaceXyz, KnownColorSpace} from 'sass'; +import {List} from 'immutable'; + +import {spaces} from './spaces'; +import {channelCases, channelNames} from './utils'; + +const spaceNames = Object.keys(spaces) as KnownColorSpace[]; + +describe('Color 4 SassColor Channels', () => { + spaceNames.forEach(spaceId => { + const space = spaces[spaceId]; + + describe(space.name, () => { + let color: SassColor; + + beforeEach(() => { + color = space.constructor(...space.pink); + }); + + describe('channelsOrNull', () => { + it('returns a list', () => { + expect(color.channelsOrNull).toFuzzyEqualList(space.pink); + expect(color.channelsOrNull.size).toBe(space.channels.length); + expect(List.isList(color.channelsOrNull)).toBeTrue(); + }); + + it('returns channel value or null, excluding alpha', () => { + const pinkCases = channelCases(...space.pink); + pinkCases.forEach(channels => { + const _color = space.constructor(...channels); + expect(_color.channelsOrNull).toFuzzyEqualList( + channels.slice(0, 3) + ); + }); + }); + }); + + describe('channels', () => { + it('returns a list', () => { + expect(color.channels).toFuzzyEqualList(space.pink); + expect(color.channels.size).toBe(space.channels.length); + expect(List.isList(color.channels)).toBeTrue(); + }); + + it('returns channel value or 0, excluding alpha', () => { + const pinkCases = channelCases(...space.pink); + pinkCases.forEach(channels => { + const expected = channels.slice(0, 3).map(channel => channel || 0); + const _color = space.constructor(...channels); + expect(_color.channels).toFuzzyEqualList(expected); + }); + }); + }); + + it('isChannelMissing', () => { + const pinkCases = channelCases(...space.pink); + pinkCases.forEach(channels => { + const expected = channels.map(channel => channel === null); + // Undefined alpha is not missing + if (expected.length === 3) expected.push(false); + const _color = space.constructor(...channels); + expect(_color.isChannelMissing(space.channels[0])).toBe(expected[0]); + expect(_color.isChannelMissing(space.channels[1])).toBe(expected[1]); + expect(_color.isChannelMissing(space.channels[2])).toBe(expected[2]); + expect(_color.isChannelMissing('alpha')).toBe(expected[3]); + }); + }); + + describe('channel', () => { + describe('without space specified', () => { + it('throws an error if channel not in space', () => { + const channelsNotInSpace = new Set(channelNames); + space.channels.forEach(channel => + channelsNotInSpace.delete(channel) + ); + channelsNotInSpace.forEach(channel => { + expect(() => color.channel(channel)).toThrow(); + }); + }); + + it('returns value if no space specified', () => { + space.channels.forEach((channel, index) => { + expect(color.channel(channel)).toFuzzyEqual(space.pink[index]); + }); + expect(color.channel('alpha')).toEqual(1); + }); + + it('returns 0 for missing channels', () => { + const nullColor = space.constructor(null, null, null, null); + space.channels.forEach(channel => { + expect(nullColor.channel(channel)).toEqual(0); + }); + expect(nullColor.channel('alpha')).toEqual(0); + }); + }); + + describe('with space specified', () => { + spaceNames.forEach(destinationSpaceId => { + it(`throws an error if channel not in ${destinationSpaceId}`, () => { + const destinationSpace = spaces[destinationSpaceId]; + const channelsNotInSpace = new Set(channelNames); + destinationSpace.channels.forEach(channel => + channelsNotInSpace.delete(channel) + ); + channelsNotInSpace.forEach(channel => { + expect(() => + color.channel(channel as ChannelNameXyz, { + space: destinationSpace.name as ColorSpaceXyz, + }) + ).toThrow(); + }); + }); + }); + + spaceNames.forEach(destinationSpaceId => { + it(`returns value when ${destinationSpaceId} is specified`, () => { + const destinationSpace = spaces[destinationSpaceId]; + destinationSpace.channels.forEach((channel, index) => { + expect( + color.channel(channel as ChannelNameXyz, { + space: destinationSpace.name as ColorSpaceXyz, + }) + ).toLooselyEqual(destinationSpace.pink[index]); + }); + expect( + color.channel('alpha' as ChannelNameXyz, { + space: destinationSpace.name as ColorSpaceXyz, + }) + ).toEqual(1); + }); + }); + }); + }); + + describe('alpha', () => { + it('returns value if set', () => { + function colorWithAlpha(alpha: number | null) { + return space.constructor(...space.pink, alpha); + } + expect(colorWithAlpha(0).alpha).toBe(0); + expect(colorWithAlpha(1).alpha).toBe(1); + expect(colorWithAlpha(0.5).alpha).toBe(0.5); + }); + + it('returns 1 if not set', () => { + const noAlphaColor = space.constructor(0, 0, 0); + expect(noAlphaColor.alpha).toBe(1); + }); + + it('returns 0 if missing', () => { + const noAlphaColor = space.constructor(0, 0, 0, null); + expect(noAlphaColor.alpha).toBe(0); + }); + }); + + if (!['hsl', 'hwb', 'lch', 'oklch'].includes(spaceId)) { + describe('isChannelPowerless', () => { + const [range1, range2, range3] = space.ranges; + checkPowerless(space.constructor(range1[0], range2[0], range3[0])); + checkPowerless(space.constructor(range1[1], range2[0], range3[0])); + checkPowerless(space.constructor(range1[1], range2[1], range3[0])); + checkPowerless(space.constructor(range1[1], range2[1], range3[1])); + checkPowerless(space.constructor(range1[0], range2[1], range3[1])); + checkPowerless(space.constructor(range1[0], range2[0], range3[1])); + checkPowerless(space.constructor(range1[1], range2[0], range3[1])); + checkPowerless(space.constructor(range1[0], range2[1], range3[0])); + }); + } + }); + }); + + describe('isChannelPowerless', () => { + describe('for HWB', () => { + // If the combined `whiteness + blackness` is great than or equal to + // `100%`, then the `hue` channel is powerless. + checkPowerless( + new SassColor({hue: 0, whiteness: 0, blackness: 100, space: 'hwb'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 0, whiteness: 100, blackness: 0, space: 'hwb'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 0, whiteness: 50, blackness: 50, space: 'hwb'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 0, whiteness: 60, blackness: 60, space: 'hwb'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 0, whiteness: -100, blackness: 200, space: 'hwb'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 0, whiteness: 200, blackness: -100, space: 'hwb'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 100, whiteness: 0, blackness: 100, space: 'hwb'}), + [true, false, false] + ); + + checkPowerless( + new SassColor({hue: 0, whiteness: 0, blackness: 0, space: 'hwb'}) + ); + checkPowerless( + new SassColor({hue: 0, whiteness: 49, blackness: 50, space: 'hwb'}) + ); + checkPowerless( + new SassColor({hue: 0, whiteness: -1, blackness: 100, space: 'hwb'}) + ); + checkPowerless( + new SassColor({hue: 100, whiteness: 0, blackness: 0, space: 'hwb'}) + ); + }); + + describe('for HSL', () => { + // If the saturation of an HSL color is 0%, then the hue component is + // powerless. + checkPowerless( + new SassColor({hue: 0, saturation: 0, lightness: 0, space: 'hsl'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 0, saturation: 0, lightness: 100, space: 'hsl'}), + [true, false, false] + ); + checkPowerless( + new SassColor({hue: 100, saturation: 0, lightness: 0, space: 'hsl'}), + [true, false, false] + ); + + checkPowerless( + new SassColor({hue: 0, saturation: 100, lightness: 0, space: 'hsl'}) + ); + checkPowerless( + new SassColor({hue: 0, saturation: 100, lightness: 100, space: 'hsl'}) + ); + checkPowerless( + new SassColor({hue: 100, saturation: 100, lightness: 100, space: 'hsl'}) + ); + checkPowerless( + new SassColor({hue: 100, saturation: 100, lightness: 0, space: 'hsl'}) + ); + }); + + describe('for LCH', () => { + // If the `chroma` value is 0%, then the `hue` channel is powerless. + checkPowerless( + new SassColor({lightness: 0, chroma: 0, hue: 0, space: 'lch'}), + [false, false, true] + ); + checkPowerless( + new SassColor({lightness: 0, chroma: 0, hue: 100, space: 'lch'}), + [false, false, true] + ); + checkPowerless( + new SassColor({lightness: 100, chroma: 0, hue: 0, space: 'lch'}), + [false, false, true] + ); + + checkPowerless( + new SassColor({lightness: 0, chroma: 100, hue: 0, space: 'lch'}) + ); + checkPowerless( + new SassColor({lightness: 0, chroma: 100, hue: 100, space: 'lch'}) + ); + checkPowerless( + new SassColor({lightness: 100, chroma: 100, hue: 100, space: 'lch'}) + ); + checkPowerless( + new SassColor({lightness: 100, chroma: 100, hue: 0, space: 'lch'}) + ); + }); + + describe('for OKLCH', () => { + // If the `chroma` value is 0%, then the `hue` channel is powerless. + checkPowerless( + new SassColor({lightness: 0, chroma: 0, hue: 0, space: 'oklch'}), + [false, false, true] + ); + checkPowerless( + new SassColor({lightness: 0, chroma: 0, hue: 100, space: 'oklch'}), + [false, false, true] + ); + checkPowerless( + new SassColor({lightness: 100, chroma: 0, hue: 0, space: 'oklch'}), + [false, false, true] + ); + + checkPowerless( + new SassColor({lightness: 0, chroma: 100, hue: 0, space: 'oklch'}) + ); + checkPowerless( + new SassColor({lightness: 0, chroma: 100, hue: 100, space: 'oklch'}) + ); + checkPowerless( + new SassColor({lightness: 100, chroma: 100, hue: 100, space: 'oklch'}) + ); + checkPowerless( + new SassColor({lightness: 100, chroma: 100, hue: 0, space: 'oklch'}) + ); + }); + }); +}); + +/** + * Creates a test that checks that the powerless channels in `color` match the + * expectation in `powerless`. + */ +function checkPowerless( + color: SassColor, + powerless = [false, false, false] +): void { + it(`${color}: ${powerless}`, () => { + const space = spaces[color.space]!; + expect(color.isChannelPowerless(space.channels[0])).toBe(powerless[0]); + expect(color.isChannelPowerless(space.channels[1])).toBe(powerless[1]); + expect(color.isChannelPowerless(space.channels[2])).toBe(powerless[2]); + }); +} diff --git a/js-api-spec/value/color/color-4-conversions.test.ts b/js-api-spec/value/color/color-4-conversions.test.ts new file mode 100644 index 0000000000..4df2de3fee --- /dev/null +++ b/js-api-spec/value/color/color-4-conversions.test.ts @@ -0,0 +1,231 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +// General space-specific info and construction + +import {SassColor} from 'sass'; +import type { + ColorSpaceXyz, + GamutMapMethod, + HueInterpolationMethod, + KnownColorSpace, +} from 'sass'; + +import {spaces} from './spaces'; +import {interpolations} from './interpolation-examples'; + +const spaceNames = Object.keys(spaces) as KnownColorSpace[]; + +describe('Color 4 SassColors Conversions', () => { + spaceNames.forEach(spaceId => { + const space = spaces[spaceId]; + + describe(space.name, () => { + let color: SassColor, blue: SassColor; + beforeEach(() => { + color = space.constructor(...space.pink); + blue = space.constructor(...space.blue); + }); + + describe('toSpace', () => { + spaceNames.forEach(destinationSpaceId => { + it(`converts pink to ${destinationSpaceId}`, () => { + const destinationSpace = spaces[destinationSpaceId]; + const res = color.toSpace(destinationSpace.name); + expect(res.space).toBe(destinationSpace.name); + + const expected = destinationSpace.constructor( + ...destinationSpace.pink + ); + expect(res).toLooselyEqualColor(expected); + }); + }); + }); + + describe('interpolate', () => { + it('interpolates examples', () => { + const examples = interpolations[space.name]; + examples.forEach(([input, output]) => { + const res = color.interpolate(blue, { + weight: input.weight, + method: input.method as HueInterpolationMethod, + }); + const outputColor = space.constructor(...output); + expect(res).toLooselyEqualColor(outputColor); + }); + }); + }); + + describe('change', () => { + it('changes all channels in own space', () => { + space.channels.forEach((channelName, index) => { + const expectedChannels = [ + space.pink[0], + space.pink[1], + space.pink[2], + ] as [number, number, number]; + expectedChannels[index] = 0; + expect(color.change({[channelName]: 0})).toLooselyEqualColor( + space.constructor(...expectedChannels) + ); + }); + expect(color.change({alpha: 0})).toLooselyEqualColor( + space.constructor(...space.pink, 0) + ); + }); + + it('change with explicit undefined makes no change', () => { + space.channels.forEach(channelName => { + expect( + color.change({[channelName]: undefined}) + ).toLooselyEqualColor(space.constructor(...space.pink)); + }); + expect(color.change({alpha: undefined})).toLooselyEqualColor( + space.constructor(...space.pink, 1) + ); + }); + + it('explicit null sets channel to missing', () => { + // Explicitly set space to avoid legacy null-alpha behavior, which is + // tested in Legacy suite. + space.channels.forEach((channelName, index) => { + const expectedChannels = [ + space.pink[0], + space.pink[1], + space.pink[2], + ] as [number | null, number | null, number | null]; + expectedChannels[index] = null; + const changed = color.change({ + [channelName]: null, + space: space.name as 'xyz', + }); + expect(changed).toLooselyEqualColor( + space.constructor(...expectedChannels) + ); + expect(changed.isChannelMissing(channelName)).toBeTrue(); + }); + expect( + color.change({alpha: null, space: space.name as 'xyz'}) + ).toLooselyEqualColor(space.constructor(...space.pink, null)); + }); + + describe('allows out-of-range channel values', () => { + const baseColor = space.constructor( + (space.ranges[0][0] + space.ranges[0][1]) / 2, + (space.ranges[1][0] + space.ranges[1][1]) / 2, + (space.ranges[2][0] + space.ranges[2][1]) / 2 + ); + for (let i = 0; i < 3; i++) { + const channel = space.channels[i]; + if (channel === 'hue') continue; + + it(`for ${channel}`, () => { + const aboveRange = space.ranges[i][1] + 10; + const belowRange = space.ranges[i][0] - 10; + const above = baseColor.change({[channel]: aboveRange}); + const below = baseColor.change({[channel]: belowRange}); + + expect(above.channels.get(i)).toEqual(aboveRange); + + switch (channel) { + case 'saturation': + expect(below.channels.get(i)).toEqual(Math.abs(belowRange)); + expect(below.channels.get(0)).toEqual( + (baseColor.channels.get(0) + 180) % 360 + ); + break; + + case 'chroma': + expect(below.channels.get(i)).toEqual(Math.abs(belowRange)); + expect(below.channels.get(2)).toEqual( + (baseColor.channels.get(2) + 180) % 360 + ); + break; + + default: + expect(below.channels.get(i)).toEqual(belowRange); + break; + } + }); + } + }); + + spaceNames.forEach(destinationSpaceId => { + it(`changes all channels with space set to ${destinationSpaceId}`, () => { + const destinationSpace = spaces[destinationSpaceId]; + destinationSpace.channels.forEach((channel, index) => { + const destinationChannels = [ + destinationSpace.pink[0], + destinationSpace.pink[1], + destinationSpace.pink[2], + ] as [number, number, number]; + + // Certain channel values cause equality issues on 1-3 of 16*16*3 + // cases. 0.45 is a magic number that works around this until the + // root cause is determined. + const scale = 0.45; + const channelValue = destinationSpace.ranges[index][1] * scale; + + destinationChannels[index] = channelValue; + const expected = destinationSpace + .constructor(...destinationChannels) + .toSpace(space.name); + + expect( + color.change({ + [channel]: channelValue, + space: destinationSpace.name as ColorSpaceXyz, + }) + ).toLooselyEqualColor(expected); + }); + }); + }); + + it('should throw on invalid alpha', () => { + expect(() => color.change({alpha: -1})).toThrow(); + expect(() => color.change({alpha: 1.1})).toThrow(); + }); + }); + + describe('isInGamut', () => { + // Our `pink` color is in gamut for every space. + it('is true for in gamut colors in own space', () => { + expect(color.isInGamut()).toBe(true); + }); + + spaceNames.forEach(destinationSpaceId => { + it(`is true for in gamut colors in ${destinationSpaceId}`, () => { + const destinationSpace = spaces[destinationSpaceId]; + expect(color.isInGamut(destinationSpace.name)).toBe(true); + }); + }); + + it(`is ${!space.hasOutOfGamut} for out of range colors in own space`, () => { + const outOfGamut = space.constructor(...space.gamutExamples[0][0]); + expect(outOfGamut.isInGamut()).toBe(!space.hasOutOfGamut); + }); + }); + + describe('toGamut', () => { + for (const [input, outputs] of space.gamutExamples) { + const outputsObj = + outputs instanceof Array + ? {clip: outputs, 'local-minde': outputs} + : outputs; + + for (const [method, output] of Object.entries(outputsObj)) { + describe(method, () => { + it(`in own space, ${input} -> ${output}`, () => { + const res = space + .constructor(...input) + .toGamut({method: method as GamutMapMethod}); + expect(res).toLooselyEqualColor(space.constructor(...output)); + }); + }); + } + } + }); + }); + }); +}); diff --git a/js-api-spec/value/color/color-4-nonparametizable.test.ts b/js-api-spec/value/color/color-4-nonparametizable.test.ts new file mode 100644 index 0000000000..e69d64019c --- /dev/null +++ b/js-api-spec/value/color/color-4-nonparametizable.test.ts @@ -0,0 +1,89 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +// Tests that can't be generally parameterized + +import {SassColor} from 'sass'; +import type { + ChannelName, + ChannelNameXyz, + ColorSpaceXyz, + GamutMapMethod, + KnownColorSpace, +} from 'sass'; + +import * as constructors from './constructors'; + +describe('Color 4 SassColors Non-parametizable', () => { + describe('toGamut', () => { + const cases: [ + SassColor, + KnownColorSpace, + Record + ][] = [ + [ + constructors.oklch(0.8, 2, 150), + 'display-p3', + { + 'local-minde': constructors.oklch( + 0.80777568417, + 0.3262439045, + 148.1202740275 + ), + clip: constructors.oklch( + 0.848829286984, + 0.3685278106, + 145.6449503702 + ), + }, + ], + [ + constructors.oklch(0.8, 2, 150), + 'srgb', + { + 'local-minde': constructors.oklch( + 0.809152570179, + 0.2379027576, + 147.4021477687 + ), + clip: constructors.oklch( + 0.866439611536, + 0.2948272403, + 142.4953388878 + ), + }, + ], + ]; + + for (const [input, space, outputs] of cases) { + describe(`with space ${space}`, () => { + for (const [method, output] of Object.entries(outputs)) { + it(`with method ${method}`, () => { + expect( + input.toGamut({space, method: method as GamutMapMethod}) + ).toLooselyEqualColor(output); + }); + } + }); + } + }); + + it('channel with space specified, missing returns 0', () => { + const cases: [SassColor, KnownColorSpace, ChannelName][] = [ + [constructors.oklch(null, null, null), 'lch', 'hue'], + [constructors.oklch(null, null, null), 'lch', 'lightness'], + [constructors.oklch(null, null, null), 'hsl', 'hue'], + [constructors.oklch(null, null, null), 'hsl', 'lightness'], + [constructors.xyz(null, null, null), 'lab', 'lightness'], + ]; + + cases.forEach(([color, space, channel]) => { + expect( + color.channel(channel as ChannelNameXyz, { + space: space as ColorSpaceXyz, + }) + ).toBe(0); + }); + }); +}); diff --git a/js-api-spec/value/color/color-4-spaces.test.ts b/js-api-spec/value/color/color-4-spaces.test.ts new file mode 100644 index 0000000000..5faad02b6c --- /dev/null +++ b/js-api-spec/value/color/color-4-spaces.test.ts @@ -0,0 +1,105 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +// General space-specific info and construction + +import {Value, SassColor} from 'sass'; +import type {KnownColorSpace} from 'sass'; + +import {spaces} from './spaces'; + +const spaceNames = Object.keys(spaces) as KnownColorSpace[]; + +describe('Color 4 SassColors Spaces', () => { + spaceNames.forEach(spaceId => { + const space = spaces[spaceId]; + + describe(space.name, () => { + let color: SassColor; + beforeEach(() => { + color = space.constructor(...space.pink); + }); + + it('is a value', () => { + expect(color).toBeInstanceOf(Value); + }); + + it('is a color', () => { + expect(color).toBeInstanceOf(SassColor); + expect(color.assertColor()).toBe(color); + }); + + it("isn't any other type", () => { + expect(() => color.assertBoolean()).toThrow(); + expect(() => color.assertCalculation()).toThrow(); + expect(() => color.assertFunction()).toThrow(); + expect(() => color.assertMap()).toThrow(); + expect(color.tryMap()).toBe(null); + expect(() => color.assertMixin()).toThrow(); + expect(() => color.assertNumber()).toThrow(); + expect(() => color.assertString()).toThrow(); + }); + + describe('allows out-of-range channel values', () => { + const average1 = (space.ranges[0][0] + space.ranges[0][1]) / 2; + const average2 = (space.ranges[1][0] + space.ranges[1][1]) / 2; + const average3 = (space.ranges[2][0] + space.ranges[2][1]) / 2; + for (let i = 0; i < 3; i++) { + const channel = space.channels[i]; + if (channel === 'hue') continue; + + it(`for ${channel}`, () => { + const aboveRange = space.ranges[i][1] + 10; + const belowRange = space.ranges[i][0] - 10; + const above = space.constructor( + i === 0 ? aboveRange : average1, + i === 1 ? aboveRange : average2, + i === 2 ? aboveRange : average3 + ); + const below = space.constructor( + i === 0 ? belowRange : average1, + i === 1 ? belowRange : average2, + i === 2 ? belowRange : average3 + ); + + expect(above.channels.get(i)).toEqual(aboveRange); + + switch (channel) { + case 'saturation': + expect(below.channels.get(i)).toEqual(Math.abs(belowRange)); + expect(below.channels.get(0)).toEqual((average1 + 180) % 360); + break; + + case 'chroma': + expect(below.channels.get(i)).toEqual(Math.abs(belowRange)); + expect(below.channels.get(2)).toEqual((average3 + 180) % 360); + break; + + default: + expect(below.channels.get(i)).toEqual(belowRange); + break; + } + }); + } + }); + + it('throws on invalid alpha', () => { + expect(() => { + space.constructor(...space.pink, -1); + }).toThrow(); + expect(() => { + space.constructor(...space.pink, 1.1); + }).toThrow(); + }); + + it(`returns name for ${space.name}`, () => { + expect(color.space).toBe(space.name); + }); + + it(`isLegacy returns ${space.isLegacy} for ${space.name}`, () => { + expect(color.isLegacy).toBe(space.isLegacy); + }); + }); + }); +}); diff --git a/js-api-spec/value/color/constructors.ts b/js-api-spec/value/color/constructors.ts new file mode 100644 index 0000000000..f41b61e90b --- /dev/null +++ b/js-api-spec/value/color/constructors.ts @@ -0,0 +1,194 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +import {SassColor} from 'sass'; + +export type Constructor = ( + channel1: number | null, + channel2: number | null, + channel3: number | null, + alpha?: number | null +) => SassColor; + +/** A utility function for creating an RGB color without specifying a space. */ +export function legacyRGB( + red: number, + green: number, + blue: number, + alpha?: number +): SassColor { + return new SassColor({red, green, blue, alpha}); +} + +/** A utility function for creating an RGB color. */ +export function rgb( + red: number | null, + green: number | null, + blue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({red, green, blue, alpha, space: 'rgb'}); +} + +/** A utility function for creating an HSL color without specifying a space. */ +export function legacyHsl( + hue: number, + saturation: number, + lightness: number, + alpha?: number +): SassColor { + return new SassColor({hue, saturation, lightness, alpha}); +} + +/** A utility function for creating an HSL color. */ +export const hsl: Constructor = function ( + hue: number | null, + saturation: number | null, + lightness: number | null, + alpha?: number | null +): SassColor { + return new SassColor({hue, saturation, lightness, alpha, space: 'hsl'}); +}; + +/** A utility function for creating an HWB color without specifying a space. */ +export const legacyHwb: Constructor = function ( + hue: number | null, + whiteness: number | null, + blackness: number | null, + alpha?: number | null +): SassColor { + return new SassColor({hue, whiteness, blackness, alpha}); +}; + +/** A utility function for creating an HWB color. */ +export const hwb: Constructor = function ( + hue: number | null, + whiteness: number | null, + blackness: number | null, + alpha?: number | null +): SassColor { + return new SassColor({hue, whiteness, blackness, alpha, space: 'hwb'}); +}; + +/** A utility function for creating a Lab color. */ +export const lab: Constructor = function ( + lightness: number | null, + a: number | null, + b: number | null, + alpha?: number | null +): SassColor { + return new SassColor({lightness, a, b, alpha, space: 'lab'}); +}; +/** A utility function for creating a Oklab color. */ +export const oklab: Constructor = function ( + lightness: number | null, + a: number | null, + b: number | null, + alpha?: number | null +): SassColor { + return new SassColor({lightness, a, b, alpha, space: 'oklab'}); +}; +/** A utility function for creating an LCH color. */ +export const lch: Constructor = function ( + lightness: number | null, + chroma: number | null, + hue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({lightness, chroma, hue, alpha, space: 'lch'}); +}; +/** A utility function for creating a Oklab color. */ +export const oklch: Constructor = function ( + lightness: number | null, + chroma: number | null, + hue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({lightness, chroma, hue, alpha, space: 'oklch'}); +}; + +/** A utility function for creating an srgb color. */ +export const srgb: Constructor = function ( + red: number | null, + green: number | null, + blue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({red, green, blue, alpha, space: 'srgb'}); +}; +/** A utility function for creating an srgb-linear color. */ +export const srgbLinear: Constructor = function ( + red: number | null, + green: number | null, + blue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({red, green, blue, alpha, space: 'srgb-linear'}); +}; +/** A utility function for creating an rec2020 color. */ +export const rec2020: Constructor = function ( + red: number | null, + green: number | null, + blue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({red, green, blue, alpha, space: 'rec2020'}); +}; +/** A utility function for creating an display-p3 color. */ +export const displayP3: Constructor = function ( + red: number | null, + green: number | null, + blue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({red, green, blue, alpha, space: 'display-p3'}); +}; +/** A utility function for creating an a98-rgb color. */ +export const a98Rgb: Constructor = function ( + red: number | null, + green: number | null, + blue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({red, green, blue, alpha, space: 'a98-rgb'}); +}; +/** A utility function for creating a prophoto-rgb color. */ +export const prophotoRgb: Constructor = function ( + red: number | null, + green: number | null, + blue: number | null, + alpha?: number | null +): SassColor { + return new SassColor({red, green, blue, alpha, space: 'prophoto-rgb'}); +}; + +/** A utility function for creating a xyz color. */ +export const xyz: Constructor = function ( + x: number | null, + y: number | null, + z: number | null, + alpha?: number | null +): SassColor { + return new SassColor({x, y, z, alpha, space: 'xyz'}); +}; + +/** A utility function for creating a xyz-d50 color. */ +export const xyzD50: Constructor = function ( + x: number | null, + y: number | null, + z: number | null, + alpha?: number | null +): SassColor { + return new SassColor({x, y, z, alpha, space: 'xyz-d50'}); +}; + +/** A utility function for creating a xyz-d65 color. */ +export const xyzD65: Constructor = function ( + x: number | null, + y: number | null, + z: number | null, + alpha?: number | null +): SassColor { + return new SassColor({x, y, z, alpha, space: 'xyz-d65'}); +}; diff --git a/js-api-spec/value/color/interpolation-examples.ts b/js-api-spec/value/color/interpolation-examples.ts new file mode 100644 index 0000000000..e3de037883 --- /dev/null +++ b/js-api-spec/value/color/interpolation-examples.ts @@ -0,0 +1,447 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +type InterpolationExample = [ + {weight: number; method?: string}, + [number, number, number] +]; + +// These interpolations are the result of mixing `pink` as the primary color +// with `blue` as the secondary color, with the specified `weight` and for polar +// spaces, the hue interpolation method `method`. These were calculated using +// [Color.js](https://colorjs.io/). +export const interpolations: {[space: string]: InterpolationExample[]} = { + lab: [ + [ + { + weight: 0.5, + }, + [58.614201646094955, 10.016665992350433, -8.387820174394456], + ], + [ + { + weight: 1, + }, + [78.27047872644108, 35.20288139978972, 1.0168442562642044], + ], + [ + { + weight: 0, + }, + [38.95792456574883, -15.169549415088852, -17.792484605053115], + ], + ], + oklab: [ + [ + { + weight: 0.5, + }, + [0.6476500020040917, 0.02748550994678843, -0.023408287379941606], + ], + [ + { + weight: 1, + }, + [0.8241000000000002, 0.10608808442731632, 0.0015900762693974446], + ], + [ + { + weight: 0, + }, + [0.47120000400818335, -0.05111706453373946, -0.048406651029280656], + ], + ], + lch: [ + [ + { + weight: 0.5, + }, + [58.61420164622054, 29.299459370089924, 295.6021177856686], + ], + [ + { + weight: 1, + }, + [78.27047872644108, 35.21756424128674, 1.6545432253797685], + ], + [ + { + weight: 0, + }, + [38.957924566, 23.38135449889311, 229.5496923459574], + ], + [ + { + weight: 0.5, + method: 'shorter', + }, + [58.61420164622054, 29.299459370089924, 295.6021177856686], + ], + [ + { + weight: 0.5, + method: 'longer', + }, + [58.61420164622054, 29.299459370089924, 115.60211778566858], + ], + [ + { + weight: 0.5, + method: 'increasing', + }, + [58.61420164622054, 29.299459370089924, 115.60211778566858], + ], + [ + { + weight: 0.5, + method: 'decreasing', + }, + [58.61420164622054, 29.299459370089924, 295.6021177856686], + ], + ], + oklch: [ + [ + { + weight: 0.5, + }, + [0.6476500020040917, 0.08824999343187809, 292.1493505923757], + ], + [ + { + weight: 1, + }, + [0.8241, 0.1061, 0.8586999999999989], + ], + [ + { + weight: 0, + }, + [0.47120000400818335, 0.07039998686375618, 223.4400011847514], + ], + [ + { + weight: 0.5, + method: 'shorter', + }, + [0.6476500020040917, 0.08824999343187809, 292.1493505923757], + ], + [ + { + weight: 0.5, + method: 'longer', + }, + [0.6476500020040917, 0.08824999343187809, 112.1493505923757], + ], + [ + { + weight: 0.5, + method: 'increasing', + }, + [0.6476500020040917, 0.08824999343187809, 112.1493505923757], + ], + [ + { + weight: 0.5, + method: 'decreasing', + }, + [0.6476500020040917, 0.08824999343187809, 292.1493505923757], + ], + ], + srgb: [ + [ + { + weight: 0.5, + }, + [0.5744899843543774, 0.5252921410815925, 0.6147851204581418], + ], + [ + { + weight: 1, + }, + [0.9999785463111585, 0.6599448662991679, 0.758373017125016], + ], + [ + { + weight: 0, + }, + [0.14900142239759617, 0.39063941586401707, 0.47119722379126755], + ], + ], + 'srgb-linear': [ + [ + { + weight: 0.5, + }, + [0.5096647054609955, 0.25972630442483197, 0.36200193586790025], + ], + [ + { + weight: 1, + }, + [0.999951196094508, 0.3930503811476254, 0.5356603778005655], + ], + [ + { + weight: 0, + }, + [0.01937821482748292, 0.12640222770203852, 0.18834349393523497], + ], + ], + 'display-p3': [ + [ + { + weight: 0.5, + }, + [0.5836172975616658, 0.530184139982079, 0.609686907635745], + ], + [ + { + weight: 1, + }, + [0.9510333333617188, 0.6749909745845027, 0.7568568353546363], + ], + [ + { + weight: 0, + }, + [0.2162012617616128, 0.38537730537965537, 0.46251697991685353], + ], + ], + 'a98-rgb': [ + [ + { + weight: 0.5, + }, + [0.5865373142666512, 0.5222346343208055, 0.6071485436534567], + ], + [ + { + weight: 1, + }, + [0.9172837001828321, 0.6540226622083835, 0.7491144397116841], + ], + [ + { + weight: 0, + }, + [0.25579092835047035, 0.3904466064332277, 0.4651826475952292], + ], + ], + 'prophoto-rgb': [ + [ + { + weight: 0.5, + }, + [0.5427623847027483, 0.4757813439417372, 0.5419635636962455], + ], + [ + { + weight: 1, + }, + [0.842345736209146, 0.6470539622987257, 0.7003583323790157], + ], + [ + { + weight: 0, + }, + [0.2431790331963506, 0.3045087255847488, 0.38356879501347535], + ], + ], + rec2020: [ + [ + { + weight: 0.5, + }, + [0.5494120530883964, 0.4907232619435038, 0.5681615893671463], + ], + [ + { + weight: 1, + }, + [0.8837118321235519, 0.6578067923850563, 0.7273197917658354], + ], + [ + { + weight: 0, + }, + [0.21511227405324085, 0.32363973150195124, 0.4090033869684574], + ], + ], + xyz: [ + [ + { + weight: 0.5, + }, + [0.36838948901950813, 0.3202564721891328, 0.38490473490885063], + ], + [ + { + weight: 1, + }, + [0.6495957411726918, 0.5323965129525022, 0.575341840710865], + ], + [ + { + weight: 0, + }, + [0.08718323686632445, 0.10811643142576338, 0.19446762910683624], + ], + ], + 'xyz-d50': [ + [ + { + weight: 0.5, + }, + [0.3740759617070767, 0.3215358224064546, 0.2908164562135577], + ], + [ + { + weight: 1, + }, + [0.6640698533004002, 0.5367266625281085, 0.4345958246720296], + ], + [ + { + weight: 0, + }, + [0.08408207011375313, 0.10634498228480066, 0.14703708775508573], + ], + ], + rgb: [ + [ + { + weight: 0.5, + }, + [146.56944672156501, 134.1448156837381, 157.00580432872178], + ], + [ + { + weight: 1, + }, + [254.9945293093454, 168.28594090628783, 193.38511936687908], + ], + [ + { + weight: 0, + }, + [38.14436413378462, 100.00369046118837, 120.62648929056449], + ], + ], + hsl: [ + [ + { + weight: 0.5, + }, + [268.816848125996, 75.96890150160368, 57.00305146997975], + ], + [ + { + weight: 1, + }, + [342.6320467744765, 99.98738302509669, 82.99617063051632], + ], + [ + { + weight: 0, + }, + [195.00164947751546, 51.95041997811069, 31.009932309443187], + ], + [ + { + weight: 0.5, + method: 'shorter', + }, + [268.816848125996, 75.96890150160368, 57.00305146997975], + ], + [ + { + weight: 0.5, + method: 'longer', + }, + [88.816848125996, 75.96890150160368, 57.00305146997975], + ], + [ + { + weight: 0.5, + method: 'increasing', + }, + [88.816848125996, 75.96890150160368, 57.00305146997975], + ], + [ + { + weight: 0.5, + method: 'decreasing', + }, + [268.816848125996, 75.96890150160368, 57.00305146997975], + ], + ], + hwb: [ + [ + { + weight: 0.5, + }, + [268.816848125996, 40.447314434838205, 26.4412114948787], + ], + [ + { + weight: 1, + }, + [342.6320467744765, 65.99448662991679, 0.002145368884157506], + ], + [ + { + weight: 0, + }, + [195.00164947751546, 14.90014223975961, 52.880277620873244], + ], + [ + { + weight: 0.5, + method: 'shorter', + }, + [268.816848125996, 40.447314434838205, 26.4412114948787], + ], + [ + { + weight: 0.5, + method: 'longer', + }, + [88.816848125996, 40.447314434838205, 26.4412114948787], + ], + [ + { + weight: 0.5, + method: 'increasing', + }, + [88.816848125996, 40.447314434838205, 26.4412114948787], + ], + [ + { + weight: 0.5, + method: 'decreasing', + }, + [268.816848125996, 40.447314434838205, 26.4412114948787], + ], + ], + 'xyz-d65': [ + [ + { + weight: 0.5, + }, + [0.36838948901950813, 0.3202564721891328, 0.38490473490885063], + ], + [ + { + weight: 1, + }, + [0.6495957411726918, 0.5323965129525022, 0.575341840710865], + ], + [ + { + weight: 0, + }, + [0.08718323686632445, 0.10811643142576338, 0.19446762910683624], + ], + ], +}; diff --git a/js-api-spec/value/color/legacy.test.ts b/js-api-spec/value/color/legacy.test.ts new file mode 100644 index 0000000000..a644849731 --- /dev/null +++ b/js-api-spec/value/color/legacy.test.ts @@ -0,0 +1,648 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +import {Value, SassColor} from 'sass'; +import {captureStdio} from '../../utils'; +import {legacyRGB, legacyHsl, legacyHwb} from './constructors'; + +describe('Legacy SassColor', () => { + describe('construction', () => { + describe('type', () => { + let color: SassColor; + beforeEach(() => { + color = legacyRGB(18, 52, 86); + }); + + it('is a value', () => { + expect(color).toBeInstanceOf(Value); + }); + + it('is a color', () => { + expect(color).toBeInstanceOf(SassColor); + expect(color.assertColor()).toBe(color); + }); + + it("isn't any other type", () => { + expect(() => color.assertBoolean()).toThrow(); + expect(() => color.assertCalculation()).toThrow(); + expect(() => color.assertFunction()).toThrow(); + expect(() => color.assertMap()).toThrow(); + expect(color.tryMap()).toBe(null); + expect(() => color.assertMixin()).toThrow(); + expect(() => color.assertNumber()).toThrow(); + expect(() => color.assertString()).toThrow(); + }); + }); + + describe('rgb()', () => { + it('allows valid values', () => { + expect(() => legacyRGB(0, 0, 0, 0)).not.toThrow(); + expect(() => legacyRGB(255, 255, 255, 1)).not.toThrow(); + }); + + it('disallows invalid alpha values', () => { + expect(() => legacyRGB(0, 0, 0, -0.1)).toThrow(); + expect(() => legacyRGB(0, 0, 0, 1.1)).toThrow(); + }); + + it('allows out-of-gamut values which were invalid before color 4', () => { + expect(() => legacyRGB(-1, 0, 0, 0)).not.toThrow(); + expect(() => legacyRGB(0, -1, 0, 0)).not.toThrow(); + expect(() => legacyRGB(0, 0, -1, 0)).not.toThrow(); + expect(() => legacyRGB(256, 0, 0, 0)).not.toThrow(); + expect(() => legacyRGB(0, 256, 0, 0)).not.toThrow(); + expect(() => legacyRGB(0, 0, 256, 0)).not.toThrow(); + }); + + it('does not round channels to the nearest integer', () => { + expect(legacyRGB(0.1, 50.4, 90.3).channels).toFuzzyEqualList([ + 0.1, 50.4, 90.3, + ]); + expect(legacyRGB(-0.1, 50.5, 90.7).channels).toFuzzyEqualList([ + -0.1, 50.5, 90.7, + ]); + }); + + describe('deprecations', () => { + it('warns with null alpha and no space', () => { + const stdio = captureStdio(() => { + new SassColor({red: 1, green: 1, blue: 1, alpha: null}); + }); + expect(stdio.err).toMatch('null-alpha'); + }); + + it("doesn't warn for undefined alpha and no space", () => { + const stdio = captureStdio(() => { + new SassColor({red: 1, green: 1, blue: 1, alpha: undefined}); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for no alpha and no space", () => { + const stdio = captureStdio(() => { + new SassColor({red: 1, green: 1, blue: 1}); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for undefined alpha and undefined space", () => { + const stdio = captureStdio(() => { + new SassColor({ + red: 1, + green: 1, + blue: 1, + alpha: undefined, + space: undefined, + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for null alpha with space", () => { + const stdio = captureStdio(() => { + new SassColor({ + red: 1, + green: 1, + blue: 1, + alpha: null, + space: 'rgb', + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + }); + }); + + describe('hsl()', () => { + it('allows valid values', () => { + expect(() => legacyHsl(0, 0, 0, 0)).not.toThrow(); + expect(() => legacyHsl(4320, 100, 100, 1)).not.toThrow(); + expect(() => legacyHsl(0, -0.1, 0, 0)).not.toThrow(); + expect(() => legacyHsl(0, 100.1, 0, 0)).not.toThrow(); + expect(() => legacyHsl(0, 0, -0.1, 0)).not.toThrow(); + expect(() => legacyHsl(0, 0, 100.1, 0)).not.toThrow(); + }); + + it('disallows invalid alpha values', () => { + expect(() => legacyHsl(0, 0, 0, -0.1)).toThrow(); + expect(() => legacyHsl(0, 0, 0, 1.1)).toThrow(); + }); + + describe('deprecations', () => { + it('warns with null alpha and no space', () => { + const stdio = captureStdio(() => { + new SassColor({hue: 1, saturation: 1, lightness: 1, alpha: null}); + }); + expect(stdio.err).toMatch('null-alpha'); + }); + + it("doesn't warn for undefined alpha and no space", () => { + const stdio = captureStdio(() => { + new SassColor({ + hue: 1, + saturation: 1, + lightness: 1, + alpha: undefined, + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for no alpha and no space", () => { + const stdio = captureStdio(() => { + new SassColor({hue: 1, saturation: 1, lightness: 1}); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for undefined alpha and undefined space", () => { + const stdio = captureStdio(() => { + new SassColor({ + hue: 1, + saturation: 1, + lightness: 1, + alpha: undefined, + space: undefined, + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for null alpha with space", () => { + const stdio = captureStdio(() => { + new SassColor({ + hue: 1, + saturation: 1, + lightness: 1, + alpha: null, + space: 'hsl', + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + }); + }); + + describe('hwb()', () => { + it('allows valid values', () => { + expect(() => legacyHwb(0, 0, 0, 0)).not.toThrow(); + expect(() => legacyHwb(4320, 100, 100, 1)).not.toThrow(); + expect(() => legacyHwb(0, -0.1, 0, 0)).not.toThrow(); + expect(() => legacyHwb(0, 0, -0.1, 0)).not.toThrow(); + expect(() => legacyHwb(0, 100.1, 0, 0)).not.toThrow(); + expect(() => legacyHwb(0, 0, 100.1, 0)).not.toThrow(); + }); + + it('disallows invalid alpha values', () => { + expect(() => legacyHwb(0, 0, 0, -0.1)).toThrow(); + expect(() => legacyHwb(0, 0, 0, 1.1)).toThrow(); + }); + + describe('deprecations', () => { + it('warns with null alpha and no space', () => { + const stdio = captureStdio(() => { + new SassColor({hue: 1, whiteness: 1, blackness: 1, alpha: null}); + }); + expect(stdio.err).toMatch('null-alpha'); + }); + + it("doesn't warn for undefined alpha and no space", () => { + const stdio = captureStdio(() => { + new SassColor({ + hue: 1, + whiteness: 1, + blackness: 1, + alpha: undefined, + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for no alpha and no space", () => { + const stdio = captureStdio(() => { + new SassColor({hue: 1, whiteness: 1, blackness: 1}); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for undefined alpha and undefined space", () => { + const stdio = captureStdio(() => { + new SassColor({ + hue: 1, + whiteness: 1, + blackness: 1, + alpha: undefined, + space: undefined, + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + + it("doesn't warn for null alpha with space", () => { + const stdio = captureStdio(() => { + new SassColor({ + hue: 1, + whiteness: 1, + blackness: 1, + alpha: null, + space: 'hwb', + }); + }); + expect(stdio.err).toBeEmptyString(); + }); + }); + }); + }); + + describe('an RGB color', () => { + let color: SassColor; + beforeEach(() => { + color = legacyRGB(18, 52, 86); + }); + + it('has RGB channels', () => { + const stdio = captureStdio(() => { + expect(color.red).toFuzzyEqual(18); + expect(color.green).toFuzzyEqual(52); + expect(color.blue).toFuzzyEqual(86); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has HSL channels', () => { + const stdio = captureStdio(() => { + expect(color.hue).toFuzzyEqual(210); + expect(color.saturation).toFuzzyEqual(65.3846153846154); + expect(color.lightness).toFuzzyEqual(20.392156862745097); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has HWB channels', () => { + const stdio = captureStdio(() => { + expect(color.hue).toFuzzyEqual(210); + expect(color.whiteness).toFuzzyEqual(7.0588235294117645); + expect(color.blackness).toFuzzyEqual(66.27450980392157); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has an alpha channel', () => { + expect(color.alpha).toBe(1); + }); + + it('equals the same color even in a different color space', () => { + expect(color).toEqualWithHash(legacyRGB(18, 52, 86)); + expect(color).toEqualWithHash( + legacyHsl(210, 65.3846153846154, 20.392156862745097) + ); + expect(color).toEqualWithHash( + legacyHwb(210, 7.0588235294117645, 66.27450980392157) + ); + }); + }); + + describe('an HSL color', () => { + let color: SassColor; + beforeEach(() => { + color = legacyHsl(120, 42, 42); + }); + + it('has RGB channels', () => { + const stdio = captureStdio(() => { + expect(color.red).toFuzzyEqual(62); + expect(color.green).toFuzzyEqual(152); + expect(color.blue).toFuzzyEqual(62); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has HSL channels', () => { + const stdio = captureStdio(() => { + expect(color.hue).toFuzzyEqual(120); + expect(color.saturation).toFuzzyEqual(42); + expect(color.lightness).toFuzzyEqual(42); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has HWB channels', () => { + const stdio = captureStdio(() => { + expect(color.hue).toFuzzyEqual(120); + expect(color.whiteness).toFuzzyEqual(24.360000000000003); + expect(color.blackness).toFuzzyEqual(40.36000000000001); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has an alpha channel', () => { + expect(color.alpha).toBe(1); + }); + + it('equals the same color even in a different color space', () => { + expect(color).toEqualWithHash(legacyRGB(62.118, 152.082, 62.118)); + expect(color).toEqualWithHash(legacyHsl(120, 42, 42)); + expect(color).toEqualWithHash(legacyHwb(120, 24.36, 40.36)); + }); + + it('allows negative hue', () => { + expect(legacyHsl(-240, 42, 42).channel('hue')).toBe(120); + expect(legacyHsl(-240, 42, 42)).toEqualWithHash(color); + }); + }); + + describe('an HWB color', () => { + let color: SassColor; + beforeEach(() => { + color = legacyHwb(120, 42, 42); + }); + + it('has RGB channels', () => { + const stdio = captureStdio(() => { + expect(color.red).toFuzzyEqual(107); + expect(color.green).toFuzzyEqual(148); + expect(color.blue).toFuzzyEqual(107); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has HSL channels', () => { + const stdio = captureStdio(() => { + expect(color.hue).toFuzzyEqual(120); + expect(color.saturation).toFuzzyEqual(16.000000000000007); + expect(color.lightness).toFuzzyEqual(50); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has HWB channels', () => { + const stdio = captureStdio(() => { + expect(color.hue).toFuzzyEqual(120); + expect(color.whiteness).toFuzzyEqual(42); + expect(color.blackness).toFuzzyEqual(42); + }); + expect(stdio.err.match(/use `channel`/g)).toBeArrayOfSize(3); + }); + + it('has an alpha channel', () => { + expect(color.alpha).toBe(1); + }); + + it('equals the same color even in a different color space', () => { + expect(color).toEqualWithHash(legacyRGB(107.1, 147.9, 107.1)); + expect(color).toEqualWithHash(legacyHsl(120, 16, 50)); + expect(color).toEqualWithHash(legacyHwb(120, 42, 42)); + }); + + it('allows negative hue', () => { + expect(legacyHwb(-240, 42, 42).channel('hue')).toBe(120); + expect(legacyHwb(-240, 42, 42)).toEqualWithHash(color); + }); + }); + + describe('changing color values', () => { + describe('change() for RGB', () => { + let color: SassColor; + beforeEach(() => { + color = legacyRGB(18, 52, 86); + }); + + it('changes RGB values', () => { + expect(color.change({red: 0})).toEqualWithHash(legacyRGB(0, 52, 86)); + expect(color.change({green: 0})).toEqualWithHash(legacyRGB(18, 0, 86)); + expect(color.change({blue: 0})).toEqualWithHash(legacyRGB(18, 52, 0)); + expect(color.change({alpha: 0.5})).toEqualWithHash( + legacyRGB(18, 52, 86, 0.5) + ); + expect( + color.change({red: 0, green: 0, blue: 0, alpha: 0.5}) + ).toEqualWithHash(legacyRGB(0, 0, 0, 0.5)); + }); + + it('allows valid values', () => { + expect(color.change({red: 0}).channel('red')).toBe(0); + expect(color.change({red: 255}).channel('red')).toBe(255); + expect(color.change({green: 0}).channel('green')).toBe(0); + expect(color.change({green: 255}).channel('green')).toBe(255); + expect(color.change({blue: 0}).channel('blue')).toBe(0); + expect(color.change({blue: 255}).channel('blue')).toBe(255); + expect(color.change({alpha: 0}).alpha).toBe(0); + expect(color.change({alpha: 1}).alpha).toBe(1); + expect(color.change({red: undefined}).channel('red')).toBe(18); + }); + + it('allows out of range values which were invalid before color 4', () => { + expect(() => color.change({red: -1})).not.toThrow(); + expect(() => color.change({red: 256})).not.toThrow(); + expect(() => color.change({green: -1})).not.toThrow(); + expect(() => color.change({green: 256})).not.toThrow(); + expect(() => color.change({blue: -1})).not.toThrow(); + expect(() => color.change({blue: 256})).not.toThrow(); + }); + + it('disallows invalid alpha values', () => { + expect(() => color.change({alpha: -0.1})).toThrow(); + expect(() => color.change({alpha: 1.1})).toThrow(); + }); + + it('does not round channels to the nearest integer', () => { + expect( + color.change({red: 0.1, green: 50.4, blue: 90.3}).channels + ).toFuzzyEqualList([0.1, 50.4, 90.3]); + expect( + color.change({red: -0.1, green: 50.5, blue: 90.9}).channels + ).toFuzzyEqualList([-0.1, 50.5, 90.9]); + }); + + it('emits deprecation for null values', () => { + const stdio = captureStdio(() => { + color.change({red: null}); + color.change({green: null}); + color.change({blue: null}); + color.change({alpha: null}); + }); + expect(stdio.err.match(/`alpha: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`red: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`green: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`blue: null`/g)).toBeArrayOfSize(1); + }); + + it('emits deprecation for channels from unspecified space', () => { + const stdio = captureStdio(() => { + color.change({hue: 1}); + }); + expect(stdio.err).toMatch('color-4-api'); + }); + }); + + describe('change() for HSL', () => { + let color: SassColor; + beforeEach(() => { + color = legacyHsl(210, 65.3846153846154, 20.392156862745097); + }); + + it('changes HSL values', () => { + expect(color.change({hue: 120})).toEqualWithHash( + legacyHsl(120, 65.3846153846154, 20.392156862745097) + ); + expect(color.change({hue: -120})).toEqualWithHash( + legacyHsl(240, 65.3846153846154, 20.392156862745097) + ); + expect(color.change({saturation: 42})).toEqualWithHash( + legacyHsl(210, 42, 20.392156862745097) + ); + expect(color.change({lightness: 42})).toEqualWithHash( + legacyHsl(210, 65.3846153846154, 42) + ); + expect(color.change({alpha: 0.5})).toEqualWithHash( + legacyHsl(210, 65.3846153846154, 20.392156862745097, 0.5) + ); + expect( + color.change({ + hue: 120, + saturation: 42, + lightness: 42, + alpha: 0.5, + }) + ).toEqualWithHash(legacyHsl(120, 42, 42, 0.5)); + expect(color.change({hue: undefined})).toEqualWithHash(color); + // Emits deprecation warning which is tested elsewhere + captureStdio(() => { + expect(color.change({hue: null})).toEqualWithHash(color); + }); + }); + + it('allows valid values', () => { + expect(color.change({saturation: 0}).channel('saturation')).toBe(0); + expect(color.change({saturation: 100}).channel('saturation')).toBe(100); + expect(color.change({lightness: 0}).channel('lightness')).toBe(0); + expect(color.change({lightness: 100}).channel('lightness')).toBe(100); + expect(color.change({alpha: 0}).alpha).toBe(0); + expect(color.change({alpha: 1}).alpha).toBe(1); + expect(color.change({lightness: -0.1}).lightness).toBe(-0.1); + expect(color.change({lightness: 100.1}).lightness).toBe(100.1); + expect(color.change({hue: undefined}).channel('hue')).toBe(210); + }); + + it('disallows invalid alpha values', () => { + expect(() => color.change({alpha: -0.1})).toThrow(); + expect(() => color.change({alpha: 1.1})).toThrow(); + }); + + it('emits deprecation for null values', () => { + const stdio = captureStdio(() => { + color.change({hue: null}); + color.change({saturation: null}); + color.change({lightness: null}); + color.change({alpha: null}); + }); + expect(stdio.err.match(/`alpha: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`hue: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`saturation: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`lightness: null`/g)).toBeArrayOfSize(1); + }); + + it('emits deprecation for channels from unspecified space', () => { + const stdio = captureStdio(() => { + color.change({red: 1}); + }); + expect(stdio.err).toMatch('color-4-api'); + }); + }); + + describe('change() for HWB', () => { + let color: SassColor; + beforeEach(() => { + color = legacyHwb(210, 7.0588235294117645, 66.27450980392157); + }); + + it('changes HWB values', () => { + expect(color.change({hue: 120})).toEqualWithHash( + legacyHwb(120, 7.0588235294117645, 66.27450980392157) + ); + expect(color.change({hue: -120})).toEqualWithHash( + legacyHwb(240, 7.0588235294117645, 66.27450980392157) + ); + expect(color.change({whiteness: 42})).toEqualWithHash( + legacyHwb(210, 42, 66.27450980392157) + ); + expect(color.change({whiteness: 50})).toEqualWithHash( + legacyHwb(210, 50, 66.27450980392157) + ); + expect(color.change({blackness: 42})).toEqualWithHash( + legacyHwb(210, 7.0588235294117645, 42) + ); + expect(color.change({alpha: 0.5})).toEqualWithHash( + legacyHwb(210, 7.0588235294117645, 66.27450980392157, 0.5) + ); + expect( + color.change({ + hue: 120, + whiteness: 42, + blackness: 42, + alpha: 0.5, + }) + ).toEqualWithHash(legacyHwb(120, 42, 42, 0.5)); + }); + + it('allows valid values', () => { + expect(color.change({whiteness: 0}).channel('whiteness')).toBe(0); + expect(color.change({whiteness: 100}).channel('whiteness')).toBe(100); + expect(color.change({blackness: 0}).channel('blackness')).toBe(0); + expect(color.change({blackness: 100}).channel('blackness')).toBe(100); + expect(color.change({alpha: 0}).alpha).toBe(0); + expect(color.change({alpha: 1}).alpha).toBe(1); + expect(color.change({hue: undefined}).channel('hue')).toBe(210); + }); + + it('disallows invalid values', () => { + expect(() => color.change({alpha: -0.1})).toThrow(); + expect(() => color.change({alpha: 1.1})).toThrow(); + }); + + it('emits deprecation for null values', () => { + const stdio = captureStdio(() => { + color.change({hue: null}); + color.change({whiteness: null}); + color.change({blackness: null}); + color.change({alpha: null}); + }); + expect(stdio.err.match(/`alpha: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`hue: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`whiteness: null`/g)).toBeArrayOfSize(1); + expect(stdio.err.match(/`blackness: null`/g)).toBeArrayOfSize(1); + }); + + it('emits deprecation for channels from unspecified space', () => { + const stdio = captureStdio(() => { + color.change({red: 1}); + }); + expect(stdio.err).toMatch('color-4-api'); + }); + }); + + describe('changeAlpha()', () => { + let color: SassColor; + beforeEach(() => { + color = legacyRGB(18, 52, 86); + }); + + it('changes the alpha value', () => { + expect(color.change({alpha: 0.5})).toEqualWithHash( + legacyRGB(18, 52, 86, 0.5) + ); + }); + + it('allows valid alphas', () => { + expect(color.change({alpha: 0}).alpha).toBe(0); + expect(color.change({alpha: 1}).alpha).toBe(1); + }); + + it('rejects invalid alphas', () => { + expect(() => color.change({alpha: -0.1})).toThrow(); + expect(() => color.change({alpha: 1.1})).toThrow(); + }); + }); + }); +}); diff --git a/js-api-spec/value/color/spaces.ts b/js-api-spec/value/color/spaces.ts new file mode 100644 index 0000000000..806fc0c17c --- /dev/null +++ b/js-api-spec/value/color/spaces.ts @@ -0,0 +1,371 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +import * as constructors from './constructors'; +import type {Constructor} from './constructors'; +import type { + ChannelName, + ChannelNameHsl, + ChannelNameHwb, + ChannelNameLab, + ChannelNameLch, + ChannelNameRgb, + ChannelNameXyz, + GamutMapMethod, + KnownColorSpace, +} from 'sass'; + +export const spaces: { + [key: string]: { + constructor: Constructor; + name: KnownColorSpace; + isLegacy: boolean; + isPolar: boolean; + // `pink` is an arbitrary color, and is a value that can roundtrip between + // all spaces. + pink: [number, number, number]; + // `blue` is an arbitrary color. + blue: [number, number, number]; + channels: ChannelName[]; + ranges: [number, number][]; + hasPowerless?: boolean; + hasOutOfGamut: boolean; + // input, output in own space, output in p3 + gamutExamples: Array< + [ + [number, number, number], + ( + | [number, number, number] + | Record + ) + ] + >; + }; +} = { + lab: { + constructor: constructors.lab, + name: 'lab', + isLegacy: false, + isPolar: false, + pink: [78.27047872644108, 35.20288139978972, 1.0168442562642044], + blue: [38.95792456574883, -15.169549415088856, -17.792484605053115], + channels: ['lightness', 'a', 'b'] as ChannelNameLab[], + ranges: [ + [0, 100], + [-125, 125], + [-125, 125], + ], + hasOutOfGamut: false, + gamutExamples: [ + [ + [50, 150, 150], + [50, 150, 150], + ], + ], + }, + oklab: { + constructor: constructors.oklab, + name: 'oklab', + isLegacy: false, + isPolar: false, + pink: [0.8241000000000002, 0.10608808442731632, 0.0015900762693974446], + blue: [0.47120000400818335, -0.05111706453373946, -0.048406651029280656], + channels: ['lightness', 'a', 'b'] as ChannelNameLab[], + ranges: [ + [0, 1], + [-0.4, 0.4], + [-0.4, 0.4], + ], + hasOutOfGamut: false, + gamutExamples: [ + [ + [0.5, 1, 1], + [0.5, 1, 1], + ], + ], + }, + lch: { + constructor: constructors.lch, + name: 'lch', + isLegacy: false, + isPolar: true, + pink: [78.27047872644108, 35.21756424128674, 1.6545432253797676], + blue: [38.957924566, 23.38135449889311, 229.54969234595737], + channels: ['lightness', 'chroma', 'hue'] as ChannelNameLch[], + hasPowerless: true, + ranges: [ + [0, 100], + [0, 150], + [0, 360], + ], + hasOutOfGamut: false, + gamutExamples: [ + [ + [50, 200, 480], + [50, 200, 480], + ], + ], + }, + oklch: { + constructor: constructors.oklch, + name: 'oklch', + isLegacy: false, + isPolar: true, + pink: [0.8241, 0.1061, 0.8587], + blue: [0.47120000400818335, 0.07039998686375618, 223.44000118475142], + channels: ['lightness', 'chroma', 'hue'] as ChannelNameLch[], + hasPowerless: true, + ranges: [ + [0, 1], + [0, 0.4], + [0, 360], + ], + hasOutOfGamut: false, + gamutExamples: [ + [ + [0.5, 1, 480], + [0.5, 1, 480], + ], + ], + }, + srgb: { + constructor: constructors.srgb, + name: 'srgb', + isLegacy: false, + isPolar: false, + pink: [0.9999785463111585, 0.6599448662991679, 0.758373017125016], + blue: [0.14900142239759614, 0.39063941586401707, 0.47119722379126755], + channels: ['red', 'green', 'blue'] as ChannelNameRgb[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: true, + gamutExamples: [ + [[0.5, 2, 2], {clip: [0.5, 1, 1], 'local-minde': [1, 1, 1]}], + ], + }, + 'srgb-linear': { + constructor: constructors.srgbLinear, + name: 'srgb-linear', + isLegacy: false, + isPolar: false, + pink: [0.999951196094508, 0.3930503811476254, 0.5356603778005655], + blue: [0.019378214827482948, 0.12640222770203852, 0.18834349393523495], + channels: ['red', 'green', 'blue'] as ChannelNameRgb[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: true, + gamutExamples: [ + [[0.5, 2, 2], {clip: [0.5, 1, 1], 'local-minde': [1, 1, 1]}], + ], + }, + 'display-p3': { + constructor: constructors.displayP3, + name: 'display-p3', + isLegacy: false, + isPolar: false, + pink: [0.9510333333617188, 0.6749909745845027, 0.7568568353546363], + blue: [0.21620126176161275, 0.38537730537965537, 0.46251697991685353], + channels: ['red', 'green', 'blue'] as ChannelNameRgb[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: true, + gamutExamples: [ + [[0.5, 2, 2], {clip: [0.5, 1, 1], 'local-minde': [1, 1, 1]}], + ], + }, + 'a98-rgb': { + constructor: constructors.a98Rgb, + name: 'a98-rgb', + isLegacy: false, + isPolar: false, + pink: [0.9172837001828321, 0.6540226622083835, 0.7491144397116841], + blue: [0.2557909283504703, 0.3904466064332277, 0.4651826475952292], + channels: ['red', 'green', 'blue'] as ChannelNameRgb[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: true, + gamutExamples: [ + [[0.5, 2, 2], {clip: [0.5, 1, 1], 'local-minde': [1, 1, 1]}], + ], + }, + 'prophoto-rgb': { + constructor: constructors.prophotoRgb, + name: 'prophoto-rgb', + isLegacy: false, + isPolar: false, + pink: [0.842345736209146, 0.6470539622987257, 0.7003583323790157], + blue: [0.24317903319635056, 0.3045087255847488, 0.38356879501347535], + channels: ['red', 'green', 'blue'] as ChannelNameRgb[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: true, + gamutExamples: [ + [[0.5, 2, 2], {clip: [0.5, 1, 1], 'local-minde': [1, 1, 1]}], + ], + }, + rec2020: { + constructor: constructors.rec2020, + name: 'rec2020', + isLegacy: false, + isPolar: false, + pink: [0.8837118321235519, 0.6578067923850563, 0.7273197917658354], + blue: [0.2151122740532409, 0.32363973150195124, 0.4090033869684574], + channels: ['red', 'green', 'blue'] as ChannelNameRgb[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: true, + gamutExamples: [ + [[0.5, 2, 2], {clip: [0.5, 1, 1], 'local-minde': [1, 1, 1]}], + ], + }, + xyz: { + constructor: constructors.xyz, + name: 'xyz', + isLegacy: false, + isPolar: false, + pink: [0.6495957411726918, 0.5323965129525022, 0.575341840710865], + blue: [0.08718323686632441, 0.1081164314257634, 0.19446762910683627], + channels: ['x', 'y', 'z'] as ChannelNameXyz[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: false, + gamutExamples: [ + [ + [0.5, 2, 2], + [0.5, 2, 2], + ], + ], + }, + 'xyz-d50': { + constructor: constructors.xyzD50, + name: 'xyz-d50', + isLegacy: false, + isPolar: false, + pink: [0.6640698533004002, 0.5367266625281085, 0.4345958246720296], + blue: [0.08408207011375313, 0.10634498228480066, 0.1470370877550857], + channels: ['x', 'y', 'z'] as ChannelNameXyz[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: false, + gamutExamples: [ + [ + [0.5, 2, 2], + [0.5, 2, 2], + ], + ], + }, + 'xyz-d65': { + constructor: constructors.xyzD65, + name: 'xyz', + isLegacy: false, + isPolar: false, + pink: [0.6495957411726918, 0.5323965129525022, 0.575341840710865], + blue: [0.08718323686632441, 0.1081164314257634, 0.19446762910683627], + channels: ['x', 'y', 'z'] as ChannelNameXyz[], + ranges: [ + [0, 1], + [0, 1], + [0, 1], + ], + hasOutOfGamut: false, + gamutExamples: [ + [ + [0.5, 2, 2], + [0.5, 2, 2], + ], + ], + }, + rgb: { + constructor: constructors.rgb, + name: 'rgb', + isLegacy: true, + isPolar: false, + pink: [254.9945293093454, 168.28594090628783, 193.38511936687908], + blue: [38.144364133784602, 100.003690461188378, 120.626489290564506], + channels: ['red', 'green', 'blue'] as ChannelNameRgb[], + ranges: [ + [0, 255], + [0, 255], + [0, 255], + ], + hasOutOfGamut: true, + gamutExamples: [ + [ + [300, 300, 300], + [255, 255, 255], + ], + ], + }, + hsl: { + constructor: constructors.hsl, + name: 'hsl', + isLegacy: true, + isPolar: true, + pink: [342.63204677447646, 99.98738302509669, 82.99617063051632], + blue: [195.0016494775154, 51.95041997811069, 31.009932309443183], + channels: ['hue', 'saturation', 'lightness'] as ChannelNameHsl[], + hasPowerless: true, + ranges: [ + [0, 360], + [0, 100], + [0, 100], + ], + hasOutOfGamut: true, + gamutExamples: [ + [ + [0.5, 110, 50], + { + clip: [0.5, 100, 50], + 'local-minde': [2.9140262667, 100, 52.0514687465], + }, + ], + ], + }, + hwb: { + constructor: constructors.hwb, + name: 'hwb', + isLegacy: true, + isPolar: true, + pink: [342.63204677447646, 65.99448662991679, 0.002145368884157506], + blue: [195.0016494775154, 14.900142239759612, 52.880277620873244], + channels: ['hue', 'whiteness', 'blackness'] as ChannelNameHwb[], + hasPowerless: true, + ranges: [ + [0, 360], + [0, 100], + [0, 100], + ], + hasOutOfGamut: true, + gamutExamples: [ + [ + [0.5, -3, -7], + {clip: [0.5, 0, 0], 'local-minde': [3.4921217446, 11.2665189221, 0]}, + ], + ], + }, +}; diff --git a/js-api-spec/value/color/utils.ts b/js-api-spec/value/color/utils.ts new file mode 100644 index 0000000000..ab91f8516c --- /dev/null +++ b/js-api-spec/value/color/utils.ts @@ -0,0 +1,44 @@ +// Copyright 2023 Google Inc. Use of this source code is governed by an +// MIT-style license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +import type {ChannelName} from 'sass'; +// Given a series of channels, returns an array of channels with a variety of +// nulls and alpha values. +export function channelCases(ch1: number, ch2: number, ch3: number) { + return [ + [ch1, ch2, ch3], + [null, ch2, ch3], + [null, null, ch3], + [ch1, null, ch3], + [ch1, null, null], + [ch1, ch2, null], + [null, ch2, null], + [null, null, null], + ].flatMap(channels => [ + channels, + [...channels, 1], + [...channels, 0], + [...channels, 0.5], + [...channels, null], + ]) as [ + [number | null, number | null, number | null, number | null | undefined] + ]; +} + +export const channelNames: ChannelName[] = [ + 'red', + 'green', + 'blue', + 'hue', + 'saturation', + 'lightness', + 'whiteness', + 'blackness', + 'a', + 'b', + 'x', + 'y', + 'z', + 'chroma', +]; diff --git a/lib/compiler.ts b/lib/compiler.ts index 7944bad68d..654d0baf4d 100644 --- a/lib/compiler.ts +++ b/lib/compiler.ts @@ -94,14 +94,15 @@ export class DartCompiler implements Compiler { this.stdin.write(`!cd ${path}\n`); this.stdin.write([...this.initArgs, ...opts].join(' ') + '\n'); - const [stdout, stderr] = ( - await Promise.all([this.stdout.next(), this.stderr.next()]) - ).map(event => event.value); - + const [stderr, stdout, status] = await Promise.all([ + this.stderr.next(), + this.stdout.next(), + this.stdout.next(), + ]); return { - stdout, - stderr, - status: +(await this.stdout.next()).value, + stdout: stdout.value, + stderr: stderr.value, + status: +status.value, }; } diff --git a/spec/core_functions/color/_utils.scss b/spec/core_functions/color/_utils.scss new file mode 100644 index 0000000000..95eff4c8a1 --- /dev/null +++ b/spec/core_functions/color/_utils.scss @@ -0,0 +1,71 @@ +@use "sass:color"; +@use 'sass:list'; +@use 'sass:meta'; + +@function -real-channel($color, $channel) { + @if color.is-missing($color, $channel) { + @return none; + } @else { + @return color.channel($color, $channel); + } +} + +@mixin inspect($color) { + a { + value: $color; + @if meta.type-of($color) == string { + type: string; + } @else { + $space: color.space($color); + space: $space; + + @if $space == 'rgb' or $space == 'srgb' or $space == 'srgb-linear' or + $space == 'display-p3' or $space == 'a98-rgb' or + $space == 'prophoto-rgb' or $space == 'rec2020' { + channels: list.slash( + -real-channel($color, 'red') + -real-channel($color, 'green') + -real-channel($color, 'blue'), + -real-channel($color, 'alpha') + ); + } @else if $space == 'hwb' { + channels: list.slash( + -real-channel($color, 'hue') + -real-channel($color, 'whiteness') + -real-channel($color, 'blackness'), + -real-channel($color, 'alpha') + ); + } @else if $space == 'hsl' { + channels: list.slash( + -real-channel($color, 'hue') + -real-channel($color, 'saturation') + -real-channel($color, 'lightness'), + -real-channel($color, 'alpha') + ); + } @else if $space == 'xyz' or $space == 'xyz-d50' { + channels: list.slash( + -real-channel($color, 'x') + -real-channel($color, 'y') + -real-channel($color, 'z'), + -real-channel($color, 'alpha') + ); + } @else if $space == 'lab' or $space == 'oklab' { + channels: list.slash( + -real-channel($color, 'lightness') + -real-channel($color, 'a') + -real-channel($color, 'b'), + -real-channel($color, 'alpha') + ); + } @else if $space == 'lch' or $space == 'oklch' { + channels: list.slash( + -real-channel($color, 'lightness') + -real-channel($color, 'chroma') + -real-channel($color, 'hue'), + -real-channel($color, 'alpha') + ); + } @else { + @error "Unknown color space #{$space}"; + } + } + } +} diff --git a/spec/core_functions/color/adjust/a98_rgb.hrx b/spec/core_functions/color/adjust/a98_rgb.hrx new file mode 100644 index 0000000000..2828f551de --- /dev/null +++ b/spec/core_functions/color/adjust/a98_rgb.hrx @@ -0,0 +1,228 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(a98-rgb 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: -10%)} + +<===> red/percent/output.css +a { + b: color(a98-rgb 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: 0.9)} + +<===> red/above_max/output.css +a { + b: color(a98-rgb 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: -0.3)} + +<===> red/below_min/output.css +a { + b: color(a98-rgb -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: 1.9)} + +<===> red/arg_above_max/output.css +a { + b: color(a98-rgb 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: -1.3)} + +<===> red/arg_below_min/output.css +a { + b: color(a98-rgb -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: -0.3)} + +<===> green/unitless/output.css +a { + b: color(a98-rgb 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(a98-rgb 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> green/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: 0.7)} + +<===> green/above_max/output.css +a { + b: color(a98-rgb 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> green/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: -0.8)} + +<===> green/below_min/output.css +a { + b: color(a98-rgb 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> green/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: 1.7)} + +<===> green/arg_above_max/output.css +a { + b: color(a98-rgb 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> green/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: -1.8)} + +<===> green/arg_below_min/output.css +a { + b: color(a98-rgb 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: -0.3)} + +<===> blue/unitless/output.css +a { + b: color(a98-rgb 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: 20%)} + +<===> blue/percent/output.css +a { + b: color(a98-rgb 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> blue/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: 0.7)} + +<===> blue/above_max/output.css +a { + b: color(a98-rgb 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> blue/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: -0.8)} + +<===> blue/below_min/output.css +a { + b: color(a98-rgb 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> blue/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: 1.7)} + +<===> blue/arg_above_max/output.css +a { + b: color(a98-rgb 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> blue/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: -1.8)} + +<===> blue/arg_below_min/output.css +a { + b: color(a98-rgb 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: 0.3, $green: 0.2, $blue: 0.1)} + +<===> all/output.css +a { + b: color(a98-rgb 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(a98-rgb 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(a98-rgb 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust/display_p3.hrx b/spec/core_functions/color/adjust/display_p3.hrx new file mode 100644 index 0000000000..eeef7b1c27 --- /dev/null +++ b/spec/core_functions/color/adjust/display_p3.hrx @@ -0,0 +1,228 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(display-p3 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: -10%)} + +<===> red/percent/output.css +a { + b: color(display-p3 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: 0.9)} + +<===> red/above_max/output.css +a { + b: color(display-p3 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: -0.3)} + +<===> red/below_min/output.css +a { + b: color(display-p3 -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: 1.9)} + +<===> red/arg_above_max/output.css +a { + b: color(display-p3 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: -1.3)} + +<===> red/arg_below_min/output.css +a { + b: color(display-p3 -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: -0.3)} + +<===> green/unitless/output.css +a { + b: color(display-p3 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(display-p3 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> green/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: 0.7)} + +<===> green/above_max/output.css +a { + b: color(display-p3 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> green/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: -0.8)} + +<===> green/below_min/output.css +a { + b: color(display-p3 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> green/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: 1.7)} + +<===> green/arg_above_max/output.css +a { + b: color(display-p3 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> green/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: -1.8)} + +<===> green/arg_below_min/output.css +a { + b: color(display-p3 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: -0.3)} + +<===> blue/unitless/output.css +a { + b: color(display-p3 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: 20%)} + +<===> blue/percent/output.css +a { + b: color(display-p3 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> blue/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: 0.7)} + +<===> blue/above_max/output.css +a { + b: color(display-p3 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> blue/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: -0.8)} + +<===> blue/below_min/output.css +a { + b: color(display-p3 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> blue/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: 1.7)} + +<===> blue/arg_above_max/output.css +a { + b: color(display-p3 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> blue/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: -1.8)} + +<===> blue/arg_below_min/output.css +a { + b: color(display-p3 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: 0.3, $green: 0.2, $blue: 0.1)} + +<===> all/output.css +a { + b: color(display-p3 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(display-p3 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(display-p3 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust_color/error/args.hrx b/spec/core_functions/color/adjust/error/args.hrx similarity index 93% rename from spec/core_functions/color/adjust_color/error/args.hrx rename to spec/core_functions/color/adjust/error/args.hrx index 03e4454c83..62b4fa08ad 100644 --- a/spec/core_functions/color/adjust_color/error/args.hrx +++ b/spec/core_functions/color/adjust/error/args.hrx @@ -35,7 +35,7 @@ Error: Only one positional argument is allowed. All other arguments must be pass a {b: color.adjust(red, $ambience: 10%)} <===> unknown/error -Error: No argument named $ambience. +Error: $ambience: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $ambience: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/adjust/error/incompatible_channel.hrx b/spec/core_functions/color/adjust/error/incompatible_channel.hrx new file mode 100644 index 0000000000..a6a8e26742 --- /dev/null +++ b/spec/core_functions/color/adjust/error/incompatible_channel.hrx @@ -0,0 +1,39 @@ +<===> legacy_space/input.scss +@use "sass:color"; +a {b: color.adjust(red, $chroma: 50%)} + +<===> legacy_space/error +Error: $chroma: Color space rgb doesn't have a channel with this name. + , +2 | a {b: color.adjust(red, $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> legacy_channel/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + +<===> legacy_channel/error +Error: $whiteness: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.adjust(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern_both/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + +<===> modern_both/error +Error: $chroma: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.adjust(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/missing.hrx b/spec/core_functions/color/adjust/error/missing.hrx new file mode 100644 index 0000000000..62832fbcb7 --- /dev/null +++ b/spec/core_functions/color/adjust/error/missing.hrx @@ -0,0 +1,67 @@ +<===> legacy/input.scss +@use "sass:color"; +a {b: color.adjust(rgb(none 0 0), $red: 10)} + +<===> legacy/error +Error: $red: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: rgb(none 0 0)). + , +2 | a {b: color.adjust(rgb(none 0 0), $red: 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern/input.scss +@use "sass:color"; +a {b: color.adjust(lab(none 0 0), $lightness: 10%)} + +<===> modern/error +Error: $lightness: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lab(none 0 0)). + , +2 | a {b: color.adjust(lab(none 0 0), $lightness: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> powerless/legacy/input.scss +@use "sass:color"; +a {b: color.adjust(grey, $hue: 10deg, $space: hsl)} + +<===> powerless/legacy/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hsl(none 0% 50.1960784314%)). + , +2 | a {b: color.adjust(grey, $hue: 10deg, $space: hsl)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> powerless/modern/input.scss +@use "sass:color"; +a {b: color.adjust(grey, $hue: 10deg, $space: lch)} + +<===> powerless/modern/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lch(53.5850134522% 0 none)). + , +2 | a {b: color.adjust(grey, $hue: 10deg, $space: lch)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/input.scss +@use "sass:color"; +a {b: color.adjust(rgb(0 0 0 / none), $alpha: 0.1)} + +<===> alpha/error +Error: $alpha: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: rgb(0 0 0 / none)). + , +2 | a {b: color.adjust(rgb(0 0 0 / none), $alpha: 0.1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/mixed_formats.hrx b/spec/core_functions/color/adjust/error/mixed_formats.hrx similarity index 83% rename from spec/core_functions/color/adjust_color/error/mixed_formats.hrx rename to spec/core_functions/color/adjust/error/mixed_formats.hrx index 152a6e6018..1eb3a9caa8 100644 --- a/spec/core_functions/color/adjust_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/adjust/error/mixed_formats.hrx @@ -3,7 +3,7 @@ a {b: color.adjust(red, $red: 1, $hue: 1)} <===> red_and_hue/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $hue: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $red: 1, $hue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.adjust(red, $green: 1, $saturation: 1%)} <===> green_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $green: 1, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.adjust(red, $blue: 1, $lightness: 1%)} <===> blue_and_lightness/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $lightness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $blue: 1, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.adjust(red, $red: 1, $blackness: 1%)} <===> red_and_blackness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $blackness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $red: 1, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: color.adjust(red, $green: 1, $whiteness: 1%)} <===> green_and_whiteness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $green: 1, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: color.adjust(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $blackness: Color space hsl doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -87,7 +87,7 @@ Error: HSL parameters may not be passed along with HWB parameters. a {b: color.adjust(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space hsl doesn't have a channel with this name. , 2 | a {b: color.adjust(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/adjust/error/space.hrx b/spec/core_functions/color/adjust/error/space.hrx new file mode 100644 index 0000000000..9741f4e26e --- /dev/null +++ b/spec/core_functions/color/adjust/error/space.hrx @@ -0,0 +1,25 @@ +<===> unknown/input.scss +@use "sass:color"; +a {b: color.adjust(red, $space: c)} + +<===> unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.adjust(red, $space: c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> quoted/input.scss +@use "sass:color"; +a {b: color.adjust(red, $space: "lab")} + +<===> quoted/error +Error: $space: Expected "lab" to be an unquoted string. + , +2 | a {b: color.adjust(red, $space: "lab")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/type.hrx b/spec/core_functions/color/adjust/error/type.hrx similarity index 82% rename from spec/core_functions/color/adjust_color/error/type.hrx rename to spec/core_functions/color/adjust/error/type.hrx index 91246fbe9d..ff2fd2e4e5 100644 --- a/spec/core_functions/color/adjust_color/error/type.hrx +++ b/spec/core_functions/color/adjust/error/type.hrx @@ -108,6 +108,20 @@ Error: $alpha: c is not a number. ' input.scss 2:7 root stylesheet +<===> +================================================================================ +<===> none/input.scss +@use "sass:color"; +a {b: color.adjust(red, $alpha: none)} + +<===> none/error +Error: $alpha: none is not a number. + , +2 | a {b: color.adjust(red, $alpha: none)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> blackness/input.scss @@ -135,3 +149,17 @@ Error: $whiteness: c is not a number. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/input.scss +@use "sass:color"; +a {b: color.adjust(red, $space: 1)} + +<===> space/error +Error: $space: 1 is not a string. + , +2 | a {b: color.adjust(red, $space: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/a98_rgb.hrx b/spec/core_functions/color/adjust/error/units/a98_rgb.hrx new file mode 100644 index 0000000000..aac8d46368 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/a98_rgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/display_p3.hrx b/spec/core_functions/color/adjust/error/units/display_p3.hrx new file mode 100644 index 0000000000..1038ec13fe --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/display_p3.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(display-p3 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/units.hrx b/spec/core_functions/color/adjust/error/units/hwb.hrx similarity index 100% rename from spec/core_functions/color/adjust_color/error/units.hrx rename to spec/core_functions/color/adjust/error/units/hwb.hrx diff --git a/spec/core_functions/color/adjust/error/units/lab.hrx b/spec/core_functions/color/adjust/error/units/lab.hrx new file mode 100644 index 0000000000..7fee8a45f9 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/lab.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.adjust(lab(50% 30 -50), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.adjust(lab(50% 30 -50), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> a/input.scss +@use "sass:color"; +a {b: color.adjust(lab(50% 30 -50), $a: 20px)} + +<===> a/error +Error: $a: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.adjust(lab(50% 30 -50), $a: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> b/input.scss +@use "sass:color"; +a {b: color.adjust(lab(50% 30 -50), $b: 20px)} + +<===> b/error +Error: $b: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.adjust(lab(50% 30 -50), $b: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/lch.hrx b/spec/core_functions/color/adjust/error/units/lch.hrx new file mode 100644 index 0000000000..d489267595 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/lch.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.adjust(lch(50% 30 50deg), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.adjust(lch(50% 30 50deg), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> chroma/input.scss +@use "sass:color"; +a {b: color.adjust(lch(50% 30 50deg), $chroma: 20px)} + +<===> chroma/error +Error: $chroma: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.adjust(lch(50% 30 50deg), $chroma: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> hue/input.scss +@use "sass:color"; +a {b: color.adjust(lch(50% 30 50deg), $hue: 20%)} + +<===> hue/error +Error: $hue: Expected 20% to have an angle unit (deg, grad, rad, turn). + , +2 | a {b: color.adjust(lch(50% 30 50deg), $hue: 20%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/oklab.hrx b/spec/core_functions/color/adjust/error/units/oklab.hrx new file mode 100644 index 0000000000..825f8e4149 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/oklab.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(50% 0.2 -0.3), $lightness: 0.3px)} + +<===> lightness/error +Error: $lightness: Expected 0.3px to have unit "%" or no units. + , +2 | a {b: color.adjust(oklab(50% 0.2 -0.3), $lightness: 0.3px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> a/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(50% 0.2 -0.3), $a: 0.2px)} + +<===> a/error +Error: $a: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.adjust(oklab(50% 0.2 -0.3), $a: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> b/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(50% 0.2 -0.3), $b: 0.2px)} + +<===> b/error +Error: $b: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.adjust(oklab(50% 0.2 -0.3), $b: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/oklch.hrx b/spec/core_functions/color/adjust/error/units/oklch.hrx new file mode 100644 index 0000000000..839c0b48ad --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/oklch.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(50% 0.3 50deg), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.adjust(oklch(50% 0.3 50deg), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> chroma/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(50% 0.3 50deg), $chroma: 0.2px)} + +<===> chroma/error +Error: $chroma: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.adjust(oklch(50% 0.3 50deg), $chroma: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> hue/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(50% 0.3 50deg), $hue: 20%)} + +<===> hue/error +Error: $hue: Expected 20% to have an angle unit (deg, grad, rad, turn). + , +2 | a {b: color.adjust(oklch(50% 0.3 50deg), $hue: 20%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/prophoto_rgb.hrx b/spec/core_functions/color/adjust/error/units/prophoto_rgb.hrx new file mode 100644 index 0000000000..3f5ba2e740 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/prophoto_rgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/rec2020.hrx b/spec/core_functions/color/adjust/error/units/rec2020.hrx new file mode 100644 index 0000000000..10ef7739aa --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/rec2020.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/srgb.hrx b/spec/core_functions/color/adjust/error/units/srgb.hrx new file mode 100644 index 0000000000..66e456e932 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/srgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/srgb_linear.hrx b/spec/core_functions/color/adjust/error/units/srgb_linear.hrx new file mode 100644 index 0000000000..ff821c6a18 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/srgb_linear.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/xyz.hrx b/spec/core_functions/color/adjust/error/units/xyz.hrx new file mode 100644 index 0000000000..488f1a44e0 --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/xyz.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz 0.2 0.5 0.7), $x: 0.5px)} + +<===> red/error +Error: $x: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(xyz 0.2 0.5 0.7), $x: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz 0.2 0.5 0.7), $y: 0.5px)} + +<===> green/error +Error: $y: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(xyz 0.2 0.5 0.7), $y: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz 0.2 0.5 0.7), $z: 0.5px)} + +<===> blue/error +Error: $z: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(xyz 0.2 0.5 0.7), $z: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/error/units/xyz_d50.hrx b/spec/core_functions/color/adjust/error/units/xyz_d50.hrx new file mode 100644 index 0000000000..dfee678cef --- /dev/null +++ b/spec/core_functions/color/adjust/error/units/xyz_d50.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: 0.5px)} + +<===> red/error +Error: $x: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: 0.5px)} + +<===> green/error +Error: $y: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: 0.5px)} + +<===> blue/error +Error: $z: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust/global.hrx b/spec/core_functions/color/adjust/global.hrx new file mode 100644 index 0000000000..d3e9f60e2b --- /dev/null +++ b/spec/core_functions/color/adjust/global.hrx @@ -0,0 +1,17 @@ +<===> legacy/input.scss +a {b: adjust-color(red, $red: -50)} + +<===> legacy/output.css +a { + b: #cd0000; +} + +<===> +================================================================================ +<===> non_legacy/input.scss +a {b: change-color(pink, $chroma: 0.01, $space: oklch)} + +<===> non_legacy/output.css +a { + b: rgb(217.7587670223, 208.8497864408, 210.1600909257); +} diff --git a/spec/core_functions/color/adjust_color/hsl.hrx b/spec/core_functions/color/adjust/hsl.hrx similarity index 65% rename from spec/core_functions/color/adjust_color/hsl.hrx rename to spec/core_functions/color/adjust/hsl.hrx index 9483abcfa5..39acc1d980 100644 --- a/spec/core_functions/color/adjust_color/hsl.hrx +++ b/spec/core_functions/color/adjust/hsl.hrx @@ -4,16 +4,16 @@ a {b: color.adjust(red, $hue: 359)} <===> hue/max/output.css a { - b: #ff0004; + b: rgb(255, 0, 4.25); } <===> ================================================================================ -<===> hue/above_max/input.scss +<===> hue/arg_above_max/input.scss @use "sass:color"; a {b: color.adjust(red, $hue: 540)} -<===> hue/above_max/output.css +<===> hue/arg_above_max/output.css a { b: aqua; } @@ -48,7 +48,7 @@ a {b: color.adjust(red, $hue: 123)} <===> hue/middle/output.css a { - b: #00ff0d; + b: rgb(0, 255, 12.75); } <===> @@ -59,18 +59,7 @@ a {b: color.adjust(red, $hue: 0.5)} <===> hue/fraction/output.css a { - b: #ff0200; -} - -<===> -================================================================================ -<===> saturation/max/input.scss -@use "sass:color"; -a {b: color.adjust(plum, $saturation: 100%)} - -<===> saturation/max/output.css -a { - b: #ff7eff; + b: rgb(255, 2.125, 0); } <===> @@ -81,7 +70,7 @@ a {b: color.adjust(plum, $saturation: 53%)} <===> saturation/max_remaining/output.css a { - b: #ff7eff; + b: hsl(300, 100.2868217054%, 74.7058823529%); } <===> @@ -103,7 +92,7 @@ a {b: color.adjust(plum, $saturation: -100%)} <===> saturation/min/output.css a { - b: #bfbfbf; + b: rgb(190.5, 190.5, 190.5); } <===> @@ -114,7 +103,7 @@ a {b: color.adjust(plum, $saturation: -48%)} <===> saturation/min_remaining/output.css a { - b: #bfbfbf; + b: rgb(190.5, 190.5, 190.5); } <===> @@ -125,7 +114,7 @@ a {b: color.adjust(plum, $saturation: 14%)} <===> saturation/high/output.css a { - b: #e697e6; + b: rgb(230.03, 150.97, 230.03); } <===> @@ -136,18 +125,51 @@ a {b: color.adjust(plum, $saturation: -14%)} <===> saturation/low/output.css a { - b: #d4a9d4; + b: rgb(211.97, 169.03, 211.97); } <===> ================================================================================ -<===> lightness/max/input.scss +<===> saturation/above_max/input.scss @use "sass:color"; -a {b: color.adjust(red, $lightness: 100%)} +a {b: color.adjust(plum, $saturation: 100%)} -<===> lightness/max/output.css +<===> saturation/above_max/output.css a { - b: white; + b: hsl(300, 147.2868217054%, 74.7058823529%); +} + +<===> +================================================================================ +<===> saturation/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(plum, $saturation: -100%)} + +<===> saturation/below_min/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> +================================================================================ +<===> saturation/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(plum, $saturation: 200%)} + +<===> saturation/arg_above_max/output.css +a { + b: hsl(300, 247.2868217054%, 74.7058823529%); +} + +<===> +================================================================================ +<===> saturation/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(plum, $saturation: -200%)} + +<===> saturation/arg_below_min/output.css +a { + b: rgb(190.5, 190.5, 190.5); } <===> @@ -180,7 +202,7 @@ a {b: color.adjust(red, $lightness: 0.5%)} <===> lightness/fraction/output.css a { - b: #ff0303; + b: rgb(255, 2.55, 2.55); } <===> @@ -191,7 +213,7 @@ a {b: color.adjust(red, $lightness: -100%)} <===> lightness/min/output.css a { - b: black; + b: hsl(0, 100%, -50%); } <===> @@ -213,7 +235,7 @@ a {b: color.adjust(red, $lightness: 14%)} <===> lightness/high/output.css a { - b: #ff4747; + b: rgb(255, 71.4, 71.4); } <===> @@ -224,7 +246,51 @@ a {b: color.adjust(red, $lightness: -14%)} <===> lightness/low/output.css a { - b: #b80000; + b: rgb(183.6, 0, 0); +} + +<===> +================================================================================ +<===> lightness/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(red, $lightness: 100%)} + +<===> lightness/above_max/output.css +a { + b: hsl(0, 100%, 150%); +} + +<===> +================================================================================ +<===> lightness/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(plum, $lightness: -100%)} + +<===> lightness/below_min/output.css +a { + b: hsl(300, 47.2868217054%, -25.2941176471%); +} + +<===> +================================================================================ +<===> lightness/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(red, $lightness: 200%)} + +<===> lightness/arg_above_max/output.css +a { + b: hsl(0, 100%, 250%); +} + +<===> +================================================================================ +<===> lightness/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(plum, $lightness: -200%)} + +<===> lightness/arg_below_min/output.css +a { + b: hsl(300, 47.2868217054%, -125.2941176471%); } <===> @@ -235,41 +301,64 @@ a {b: color.adjust(black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> all/output.css a { - b: #98695d; + b: rgb(151.776, 104.7744, 93.024); } <===> ================================================================================ <===> alpha_input/input.scss @use "sass:color"; -a {b: color.adjust(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} +a { + b: color.adjust( + rgba(black, 0.7), + $hue: 12, + $saturation: 24%, + $lightness: 48% + ); +} <===> alpha_input/output.css a { - b: rgba(152, 105, 93, 0.7); + b: rgba(151.776, 104.7744, 93.024, 0.7); } <===> ================================================================================ <===> alpha_arg/input.scss @use "sass:color"; -a {b: color.adjust(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: -0.7)} +a { + b: color.adjust( + black, + $hue: 12, + $saturation: 24%, + $lightness: 48%, + $alpha: -0.7 + ); +} <===> alpha_arg/output.css a { - b: rgba(152, 105, 93, 0.3); + b: rgba(151.776, 104.7744, 93.024, 0.3); } <===> ================================================================================ <===> alpha_arg_above_max/input.scss -@use "sass:color"; // Regression test for sass/dart-sass#708. -a {b: color.adjust(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} +@use "sass:color"; +a { + b: color.adjust( + black, + $hue: 12, + $saturation: 24%, + $lightness: 48%, + $alpha: 0.7 + ); +} <===> alpha_arg_above_max/output.css a { - b: #98695d; + b: rgb(151.776, 104.7744, 93.024); } <===> @@ -280,5 +369,5 @@ a {b: color.adjust($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> named/output.css a { - b: #98695d; + b: rgb(151.776, 104.7744, 93.024); } diff --git a/spec/core_functions/color/adjust_color/hwb.hrx b/spec/core_functions/color/adjust/hwb.hrx similarity index 91% rename from spec/core_functions/color/adjust_color/hwb.hrx rename to spec/core_functions/color/adjust/hwb.hrx index f50161a492..0e38a7b017 100644 --- a/spec/core_functions/color/adjust_color/hwb.hrx +++ b/spec/core_functions/color/adjust/hwb.hrx @@ -4,7 +4,7 @@ a {b: color.adjust(#cc6666, $whiteness: 100%)} <===> whiteness/max/output.css a { - b: #d5d5d5; + b: rgb(223.125, 223.125, 223.125); } <===> @@ -15,7 +15,7 @@ a {b: color.adjust(#cc6666, $whiteness: 60%)} <===> whiteness/max_remaining/output.css a { - b: #d5d5d5; + b: rgb(212.5, 212.5, 212.5); } <===> @@ -37,7 +37,7 @@ a {b: color.adjust(#cc6666, $whiteness: -100%)} <===> whiteness/min/output.css a { - b: #cc0000; + b: hsl(0, 700%, 10%); } <===> @@ -81,7 +81,7 @@ a {b: color.adjust(#993333, $blackness: 100%)} <===> blackness/max/output.css a { - b: #2b2b2b; + b: rgb(31.875, 31.875, 31.875); } <===> @@ -92,7 +92,7 @@ a {b: color.adjust(#993333, $blackness: 60%)} <===> blackness/max_remaining/output.css a { - b: #2b2b2b; + b: rgb(42.5, 42.5, 42.5); } <===> @@ -114,7 +114,7 @@ a {b: color.adjust(#993333, $blackness: -100%)} <===> blackness/min/output.css a { - b: #ff3333; + b: hsl(0, 700%, 90%); } <===> @@ -176,7 +176,15 @@ a { ================================================================================ <===> alpha_arg/input.scss @use "sass:color"; -a {b: color.adjust(red, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: -0.7)} +a { + b: color.adjust( + red, + $hue: 150, + $whiteness: 20%, + $blackness: 40%, + $alpha: -0.7 + ); +} <===> alpha_arg/output.css a { @@ -187,7 +195,15 @@ a { ================================================================================ <===> alpha_arg_above_max/input.scss @use "sass:color"; -a {b: color.adjust(red, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: 0.7)} +a { + b: color.adjust( + red, + $hue: 150, + $whiteness: 20%, + $blackness: 40%, + $alpha: 0.7 + ); +} <===> alpha_arg_above_max/output.css a { diff --git a/spec/core_functions/color/adjust/lab.hrx b/spec/core_functions/color/adjust/lab.hrx new file mode 100644 index 0000000000..78468941f6 --- /dev/null +++ b/spec/core_functions/color/adjust/lab.hrx @@ -0,0 +1,228 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: 50)} + +<===> lightness/unitless/output.css +a { + b: lab(80% 60 -100); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: -10%)} + +<===> lightness/percent/output.css +a { + b: lab(20% 60 -100); +} + +<===> +================================================================================ +<===> lightness/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: 90)} + +<===> lightness/above_max/output.css +a { + b: lab(100% 60 -100); +} + +<===> +================================================================================ +<===> lightness/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: -40%)} + +<===> lightness/below_min/output.css +a { + b: lab(0% 60 -100); +} + +<===> +================================================================================ +<===> lightness/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: 120%)} + +<===> lightness/arg_above_max/output.css +a { + b: lab(100% 60 -100); +} + +<===> +================================================================================ +<===> lightness/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: -130%)} + +<===> lightness/arg_below_min/output.css +a { + b: lab(0% 60 -100); +} + +<===> +================================================================================ +<===> a/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $a: -30)} + +<===> a/unitless/output.css +a { + b: lab(30% 30 -100); +} + +<===> +================================================================================ +<===> a/percent/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $a: 40%)} + +<===> a/percent/output.css +a { + b: lab(30% 110 -100); +} + +<===> +================================================================================ +<===> a/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $a: 70)} + +<===> a/above_max/output.css +a { + b: lab(30% 130 -100); +} + +<===> +================================================================================ +<===> a/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $a: -200)} + +<===> a/below_min/output.css +a { + b: lab(30% -140 -100); +} + +<===> +================================================================================ +<===> a/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $a: 130)} + +<===> a/arg_above_max/output.css +a { + b: lab(30% 190 -100); +} + +<===> +================================================================================ +<===> a/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $a: -500)} + +<===> a/arg_below_min/output.css +a { + b: lab(30% -440 -100); +} + +<===> +================================================================================ +<===> b/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $b: -30)} + +<===> b/unitless/output.css +a { + b: lab(30% 60 -130); +} + +<===> +================================================================================ +<===> b/percent/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $b: 20%)} + +<===> b/percent/output.css +a { + b: lab(30% 60 -75); +} + +<===> +================================================================================ +<===> b/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $b: 70)} + +<===> b/above_max/output.css +a { + b: lab(30% 60 -30); +} + +<===> +================================================================================ +<===> b/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $b: -80)} + +<===> b/below_min/output.css +a { + b: lab(30% 60 -180); +} + +<===> +================================================================================ +<===> b/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $b: 500)} + +<===> b/arg_above_max/output.css +a { + b: lab(30% 60 400); +} + +<===> +================================================================================ +<===> b/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $b: -500)} + +<===> b/arg_below_min/output.css +a { + b: lab(30% 60 -600); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: 40%, $a: 50, $b: 60)} + +<===> all/output.css +a { + b: lab(70% 110 -40); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100 / 0.9), $lightness: 50%)} + +<===> alpha_input/output.css +a { + b: lab(80% 60 -100 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(lab(30% 60 -100), $lightness: 50%, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: lab(80% 60 -100 / 0.9); +} diff --git a/spec/core_functions/color/adjust/lch.hrx b/spec/core_functions/color/adjust/lch.hrx new file mode 100644 index 0000000000..139328a5c3 --- /dev/null +++ b/spec/core_functions/color/adjust/lch.hrx @@ -0,0 +1,184 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: 50)} + +<===> lightness/unitless/output.css +a { + b: lch(80% 60 180deg); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: -10%)} + +<===> lightness/percent/output.css +a { + b: lch(20% 60 180deg); +} + +<===> +================================================================================ +<===> lightness/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: 90)} + +<===> lightness/above_max/output.css +a { + b: lch(100% 60 180deg); +} + +<===> +================================================================================ +<===> lightness/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: -40%)} + +<===> lightness/below_min/output.css +a { + b: lch(0% 60 180deg); +} + +<===> +================================================================================ +<===> lightness/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: 120%)} + +<===> lightness/arg_above_max/output.css +a { + b: lch(100% 60 180deg); +} + +<===> +================================================================================ +<===> lightness/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: -130%)} + +<===> lightness/arg_below_min/output.css +a { + b: lch(0% 60 180deg); +} + +<===> +================================================================================ +<===> chroma/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $chroma: -30)} + +<===> chroma/unitless/output.css +a { + b: lch(30% 30 180deg); +} + +<===> +================================================================================ +<===> chroma/percent/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $chroma: 40%)} + +<===> chroma/percent/output.css +a { + b: lch(30% 120 180deg); +} + +<===> +================================================================================ +<===> chroma/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $chroma: 100)} + +<===> chroma/above_max/output.css +a { + b: lch(30% 160 180deg); +} + +<===> +================================================================================ +<===> chroma/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $chroma: -100)} + +<===> chroma/below_min/output.css +a { + b: lch(30% 0 180deg); +} + +<===> +================================================================================ +<===> chroma/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $chroma: 200)} + +<===> chroma/arg_above_max/output.css +a { + b: lch(30% 260 180deg); +} + +<===> +================================================================================ +<===> chroma/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $chroma: -200)} + +<===> chroma/arg_below_min/output.css +a { + b: lch(30% 0 180deg); +} + +<===> +================================================================================ +<===> hue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $hue: -30)} + +<===> hue/unitless/output.css +a { + b: lch(30% 60 150deg); +} + +<===> +================================================================================ +<===> hue/turn/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $hue: 0.5turn)} + +<===> hue/turn/output.css +a { + b: lch(30% 60 0deg); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: 40%, $chroma: 50, $hue: 60)} + +<===> all/output.css +a { + b: lch(70% 110 240deg); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg / 0.9), $lightness: 50%)} + +<===> alpha_input/output.css +a { + b: lch(80% 60 180deg / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(lch(30% 60 180deg), $lightness: 50%, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: lch(80% 60 180deg / 0.9); +} diff --git a/spec/core_functions/color/adjust_color/no_rgb_hsl.hrx b/spec/core_functions/color/adjust/no_channels.hrx similarity index 75% rename from spec/core_functions/color/adjust_color/no_rgb_hsl.hrx rename to spec/core_functions/color/adjust/no_channels.hrx index e5b0c8ab97..297ee4362d 100644 --- a/spec/core_functions/color/adjust_color/no_rgb_hsl.hrx +++ b/spec/core_functions/color/adjust/no_channels.hrx @@ -18,17 +18,6 @@ a { b: red; } -<===> -================================================================================ -<===> alpha/max/input.scss -@use "sass:color"; -a {b: color.adjust(rgba(red, 0.5), $alpha: 1)} - -<===> alpha/max/output.css -a { - b: red; -} - <===> ================================================================================ <===> alpha/max_remaining/input.scss @@ -53,11 +42,44 @@ a { <===> ================================================================================ -<===> alpha/min/input.scss +<===> alpha/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: 1)} + +<===> alpha/above_max/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> alpha/below_min/input.scss @use "sass:color"; a {b: color.adjust(rgba(red, 0.5), $alpha: -1)} -<===> alpha/min/output.css +<===> alpha/below_min/output.css +a { + b: rgba(255, 0, 0, 0); +} + +<===> +================================================================================ +<===> alpha/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: 2)} + +<===> alpha/arg_above_max/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> alpha/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: -2)} + +<===> alpha/arg_below_min/output.css a { b: rgba(255, 0, 0, 0); } diff --git a/spec/core_functions/color/adjust/oklab.hrx b/spec/core_functions/color/adjust/oklab.hrx new file mode 100644 index 0000000000..ca3fef77f8 --- /dev/null +++ b/spec/core_functions/color/adjust/oklab.hrx @@ -0,0 +1,228 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: 0.5)} + +<===> lightness/unitless/output.css +a { + b: oklab(80% 0.1 -0.3); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: -10%)} + +<===> lightness/percent/output.css +a { + b: oklab(20% 0.1 -0.3); +} + +<===> +================================================================================ +<===> lightness/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: 0.9)} + +<===> lightness/above_max/output.css +a { + b: oklab(100% 0.1 -0.3); +} + +<===> +================================================================================ +<===> lightness/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: -40%)} + +<===> lightness/below_min/output.css +a { + b: oklab(0% 0.1 -0.3); +} + +<===> +================================================================================ +<===> lightness/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: 120%)} + +<===> lightness/arg_above_max/output.css +a { + b: oklab(100% 0.1 -0.3); +} + +<===> +================================================================================ +<===> lightness/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: -130%)} + +<===> lightness/arg_below_min/output.css +a { + b: oklab(0% 0.1 -0.3); +} + +<===> +================================================================================ +<===> a/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $a: -0.2)} + +<===> a/unitless/output.css +a { + b: oklab(30% -0.1 -0.3); +} + +<===> +================================================================================ +<===> a/percent/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $a: 40%)} + +<===> a/percent/output.css +a { + b: oklab(30% 0.26 -0.3); +} + +<===> +================================================================================ +<===> a/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $a: 0.7)} + +<===> a/above_max/output.css +a { + b: oklab(30% 0.8 -0.3); +} + +<===> +================================================================================ +<===> a/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $a: -0.6)} + +<===> a/below_min/output.css +a { + b: oklab(30% -0.5 -0.3); +} + +<===> +================================================================================ +<===> a/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $a: 1)} + +<===> a/arg_above_max/output.css +a { + b: oklab(30% 1.1 -0.3); +} + +<===> +================================================================================ +<===> a/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $a: -1)} + +<===> a/arg_below_min/output.css +a { + b: oklab(30% -0.9 -0.3); +} + +<===> +================================================================================ +<===> b/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $b: -0.05)} + +<===> b/unitless/output.css +a { + b: oklab(30% 0.1 -0.35); +} + +<===> +================================================================================ +<===> b/percent/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $b: 20%)} + +<===> b/percent/output.css +a { + b: oklab(30% 0.1 -0.22); +} + +<===> +================================================================================ +<===> b/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $b: 0.8)} + +<===> b/above_max/output.css +a { + b: oklab(30% 0.1 0.5); +} + +<===> +================================================================================ +<===> b/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $b: -0.2)} + +<===> b/below_min/output.css +a { + b: oklab(30% 0.1 -0.5); +} + +<===> +================================================================================ +<===> b/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $b: 1)} + +<===> b/arg_above_max/output.css +a { + b: oklab(30% 0.1 0.7); +} + +<===> +================================================================================ +<===> b/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $b: -1)} + +<===> b/arg_below_min/output.css +a { + b: oklab(30% 0.1 -1.3); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: 40%, $a: 0.2, $b: 0.3)} + +<===> all/output.css +a { + b: oklab(70% 0.3 0); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3 / 0.9), $lightness: 50%)} + +<===> alpha_input/output.css +a { + b: oklab(80% 0.1 -0.3 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(oklab(30% 0.1 -0.3), $lightness: 50%, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: oklab(80% 0.1 -0.3 / 0.9); +} diff --git a/spec/core_functions/color/adjust/oklch.hrx b/spec/core_functions/color/adjust/oklch.hrx new file mode 100644 index 0000000000..cf5e0e2fc6 --- /dev/null +++ b/spec/core_functions/color/adjust/oklch.hrx @@ -0,0 +1,184 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: 0.5)} + +<===> lightness/unitless/output.css +a { + b: oklch(80% 0.15 180deg); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: -10%)} + +<===> lightness/percent/output.css +a { + b: oklch(20% 0.15 180deg); +} + +<===> +================================================================================ +<===> lightness/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: 0.9)} + +<===> lightness/above_max/output.css +a { + b: oklch(100% 0.15 180deg); +} + +<===> +================================================================================ +<===> lightness/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: -40%)} + +<===> lightness/below_min/output.css +a { + b: oklch(0% 0.15 180deg); +} + +<===> +================================================================================ +<===> lightness/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: 120%)} + +<===> lightness/arg_above_max/output.css +a { + b: oklch(100% 0.15 180deg); +} + +<===> +================================================================================ +<===> lightness/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: -130%)} + +<===> lightness/arg_below_min/output.css +a { + b: oklch(0% 0.15 180deg); +} + +<===> +================================================================================ +<===> chroma/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $chroma: -0.1)} + +<===> chroma/unitless/output.css +a { + b: oklch(30% 0.05 180deg); +} + +<===> +================================================================================ +<===> chroma/percent/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $chroma: 40%)} + +<===> chroma/percent/output.css +a { + b: oklch(30% 0.31 180deg); +} + +<===> +================================================================================ +<===> chroma/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $chroma: 0.3)} + +<===> chroma/above_max/output.css +a { + b: oklch(30% 0.45 180deg); +} + +<===> +================================================================================ +<===> chroma/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $chroma: -0.2)} + +<===> chroma/below_min/output.css +a { + b: oklch(30% 0 180deg); +} + +<===> +================================================================================ +<===> chroma/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $chroma: 1)} + +<===> chroma/arg_above_max/output.css +a { + b: oklch(30% 1.15 180deg); +} + +<===> +================================================================================ +<===> chroma/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $chroma: -1)} + +<===> chroma/arg_below_min/output.css +a { + b: oklch(30% 0 180deg); +} + +<===> +================================================================================ +<===> hue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $hue: -30)} + +<===> hue/unitless/output.css +a { + b: oklch(30% 0.15 150deg); +} + +<===> +================================================================================ +<===> hue/turn/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $hue: 0.5turn)} + +<===> hue/turn/output.css +a { + b: oklch(30% 0.15 0deg); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: 40%, $chroma: 0.2, $hue: 60)} + +<===> all/output.css +a { + b: oklch(70% 0.35 240deg); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg / 0.9), $lightness: 50%)} + +<===> alpha_input/output.css +a { + b: oklch(80% 0.15 180deg / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(30% 0.15 180deg), $lightness: 50%, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: oklch(80% 0.15 180deg / 0.9); +} diff --git a/spec/core_functions/color/adjust/prophoto_rgb.hrx b/spec/core_functions/color/adjust/prophoto_rgb.hrx new file mode 100644 index 0000000000..25890ca132 --- /dev/null +++ b/spec/core_functions/color/adjust/prophoto_rgb.hrx @@ -0,0 +1,228 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(prophoto-rgb 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: -10%)} + +<===> red/percent/output.css +a { + b: color(prophoto-rgb 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.9)} + +<===> red/above_max/output.css +a { + b: color(prophoto-rgb 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: -0.3)} + +<===> red/below_min/output.css +a { + b: color(prophoto-rgb -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: 1.9)} + +<===> red/arg_above_max/output.css +a { + b: color(prophoto-rgb 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: -1.3)} + +<===> red/arg_below_min/output.css +a { + b: color(prophoto-rgb -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: -0.3)} + +<===> green/unitless/output.css +a { + b: color(prophoto-rgb 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(prophoto-rgb 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> green/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.7)} + +<===> green/above_max/output.css +a { + b: color(prophoto-rgb 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> green/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: -0.8)} + +<===> green/below_min/output.css +a { + b: color(prophoto-rgb 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> green/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: 1.7)} + +<===> green/arg_above_max/output.css +a { + b: color(prophoto-rgb 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> green/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $green: -1.8)} + +<===> green/arg_below_min/output.css +a { + b: color(prophoto-rgb 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: -0.3)} + +<===> blue/unitless/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: 20%)} + +<===> blue/percent/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> blue/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.7)} + +<===> blue/above_max/output.css +a { + b: color(prophoto-rgb 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> blue/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: -0.8)} + +<===> blue/below_min/output.css +a { + b: color(prophoto-rgb 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> blue/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: 1.7)} + +<===> blue/arg_above_max/output.css +a { + b: color(prophoto-rgb 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> blue/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $blue: -1.8)} + +<===> blue/arg_below_min/output.css +a { + b: color(prophoto-rgb 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.3, $green: 0.2, $blue: 0.1)} + +<===> all/output.css +a { + b: color(prophoto-rgb 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(prophoto-rgb 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(prophoto-rgb 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust/rec2020.hrx b/spec/core_functions/color/adjust/rec2020.hrx new file mode 100644 index 0000000000..6b0e2a74bb --- /dev/null +++ b/spec/core_functions/color/adjust/rec2020.hrx @@ -0,0 +1,228 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(rec2020 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: -10%)} + +<===> red/percent/output.css +a { + b: color(rec2020 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: 0.9)} + +<===> red/above_max/output.css +a { + b: color(rec2020 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: -0.3)} + +<===> red/below_min/output.css +a { + b: color(rec2020 -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: 1.9)} + +<===> red/arg_above_max/output.css +a { + b: color(rec2020 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: -1.3)} + +<===> red/arg_below_min/output.css +a { + b: color(rec2020 -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: -0.3)} + +<===> green/unitless/output.css +a { + b: color(rec2020 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(rec2020 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> green/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: 0.7)} + +<===> green/above_max/output.css +a { + b: color(rec2020 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> green/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: -0.8)} + +<===> green/below_min/output.css +a { + b: color(rec2020 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> green/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: 1.7)} + +<===> green/arg_above_max/output.css +a { + b: color(rec2020 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> green/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $green: -1.8)} + +<===> green/arg_below_min/output.css +a { + b: color(rec2020 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: -0.3)} + +<===> blue/unitless/output.css +a { + b: color(rec2020 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: 20%)} + +<===> blue/percent/output.css +a { + b: color(rec2020 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> blue/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: 0.7)} + +<===> blue/above_max/output.css +a { + b: color(rec2020 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> blue/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: -0.8)} + +<===> blue/below_min/output.css +a { + b: color(rec2020 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> blue/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: 1.7)} + +<===> blue/arg_above_max/output.css +a { + b: color(rec2020 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> blue/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $blue: -1.8)} + +<===> blue/arg_below_min/output.css +a { + b: color(rec2020 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: 0.3, $green: 0.2, $blue: 0.1)} + +<===> all/output.css +a { + b: color(rec2020 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(rec2020 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(rec2020 0.2 0.5 0.7), $red: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(rec2020 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust/rgb.hrx b/spec/core_functions/color/adjust/rgb.hrx new file mode 100644 index 0000000000..8ae06f087b --- /dev/null +++ b/spec/core_functions/color/adjust/rgb.hrx @@ -0,0 +1,338 @@ +<===> red/max/input.scss +@use "sass:color"; +a {b: color.adjust(black, $red: 255)} + +<===> red/max/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> red/min/input.scss +@use "sass:color"; +a {b: color.adjust(red, $red: -255)} + +<===> red/min/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> red/zero/input.scss +@use "sass:color"; +a {b: color.adjust(black, $red: 0)} + +<===> red/zero/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> red/low/input.scss +@use "sass:color"; +a {b: color.adjust(red, $red: -100)} + +<===> red/low/output.css +a { + b: #9b0000; +} + +<===> +================================================================================ +<===> red/high/input.scss +@use "sass:color"; +a {b: color.adjust(black, $red: 200)} + +<===> red/high/output.css +a { + b: #c80000; +} + +<===> +================================================================================ +<===> red/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $red: 200)} + +<===> red/above_max/output.css +a { + b: #ffcdef; +} + +<===> +================================================================================ +<===> red/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $red: -200)} + +<===> red/below_min/output.css +a { + b: #00cdef; +} + +<===> +================================================================================ +<===> red/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $red: 500)} + +<===> red/arg_above_max/output.css +a { + b: #ffcdef; +} + +<===> +================================================================================ +<===> red/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $red: -500)} + +<===> red/arg_below_min/output.css +a { + b: #00cdef; +} + +<===> +================================================================================ +<===> green/max/input.scss +@use "sass:color"; +a {b: color.adjust(black, $green: 255)} + +<===> green/max/output.css +a { + b: lime; +} + +<===> +================================================================================ +<===> green/min/input.scss +@use "sass:color"; +a {b: color.adjust(lime, $green: -255)} + +<===> green/min/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> green/zero/input.scss +@use "sass:color"; +a {b: color.adjust(black, $green: 0)} + +<===> green/zero/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> green/low/input.scss +@use "sass:color"; +a {b: color.adjust(lime, $green: -100)} + +<===> green/low/output.css +a { + b: #009b00; +} + +<===> +================================================================================ +<===> green/high/input.scss +@use "sass:color"; +a {b: color.adjust(black, $green: 200)} + +<===> green/high/output.css +a { + b: #00c800; +} + +<===> +================================================================================ +<===> green/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $green: 200)} + +<===> green/above_max/output.css +a { + b: #abffef; +} + +<===> +================================================================================ +<===> green/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $green: -210)} + +<===> green/below_min/output.css +a { + b: #ab00ef; +} + +<===> +================================================================================ +<===> green/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $green: 500)} + +<===> green/arg_above_max/output.css +a { + b: #abffef; +} + +<===> +================================================================================ +<===> green/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $green: -500)} + +<===> green/arg_below_min/output.css +a { + b: #ab00ef; +} + +<===> +================================================================================ +<===> blue/max/input.scss +@use "sass:color"; +a {b: color.adjust(black, $blue: 255)} + +<===> blue/max/output.css +a { + b: blue; +} + +<===> +================================================================================ +<===> blue/min/input.scss +@use "sass:color"; +a {b: color.adjust(blue, $blue: -255)} + +<===> blue/min/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> blue/zero/input.scss +@use "sass:color"; +a {b: color.adjust(black, $blue: 0)} + +<===> blue/zero/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> blue/low/input.scss +@use "sass:color"; +a {b: color.adjust(blue, $blue: -100)} + +<===> blue/low/output.css +a { + b: #00009b; +} + +<===> +================================================================================ +<===> blue/high/input.scss +@use "sass:color"; +a {b: color.adjust(black, $blue: 200)} + +<===> blue/high/output.css +a { + b: #0000c8; +} + +<===> +================================================================================ +<===> blue/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(#fedcba, $blue: 200)} + +<===> blue/above_max/output.css +a { + b: #fedcff; +} + +<===> +================================================================================ +<===> blue/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(#fedcba, $blue: -200)} + +<===> blue/below_min/output.css +a { + b: #fedc00; +} + +<===> +================================================================================ +<===> blue/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(#fedcba, $blue: 500)} + +<===> blue/arg_above_max/output.css +a { + b: #fedcff; +} + +<===> +================================================================================ +<===> blue/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(#fedcba, $blue: -500)} + +<===> blue/arg_below_min/output.css +a { + b: #fedc00; +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(black, $red: 12, $green: 24, $blue: 48)} + +<===> all/output.css +a { + b: #0c1830; +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} + +<===> alpha_input/output.css +a { + b: rgba(12, 24, 48, 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(black, $red: 12, $green: 24, $blue: 48, $alpha: -0.3)} + +<===> alpha_arg/output.css +a { + b: rgba(12, 24, 48, 0.7); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.adjust($color: black, $red: 12, $green: 24, $blue: 48)} + +<===> named/output.css +a { + b: #0c1830; +} diff --git a/spec/core_functions/color/adjust/space.hrx b/spec/core_functions/color/adjust/space.hrx new file mode 100644 index 0000000000..cb8662cf74 --- /dev/null +++ b/spec/core_functions/color/adjust/space.hrx @@ -0,0 +1,151 @@ +<===> identical/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(50% 0.2 0deg), $space: lab)} + +<===> identical/output.css +a { + b: oklch(50% 0.2 0deg); +} + +<===> +================================================================================ +<===> legacy/to_legacy/input.scss +@use "sass:color"; +a {b: color.adjust(pink, $saturation: -5%, $space: hsl)} + +<===> legacy/to_legacy/output.css +a { + b: rgb(253.425, 193.575, 204.025); +} + +<===> +================================================================================ +<===> legacy/to_modern/input.scss +@use "sass:color"; +a {b: color.adjust(pink, $chroma: -0.01, $space: oklch)} + +<===> legacy/to_modern/output.css +a { + b: rgb(249.5073873455, 194.8272088475, 204.1290090118); +} + +<===> +================================================================================ +<===> modern/to_legacy/input.scss +@use "sass:color"; +a {b: color.adjust(lab(50% 10 -20), $saturation: 5%, $space: hsl)} + +<===> modern/to_legacy/output.css +a { + b: lab(48.2797960499% 13.4192461856 -26.2119638245); +} + +<===> +================================================================================ +<===> modern/to_modern/input.scss +@use "sass:color"; +a {b: color.adjust(lab(50% 10 -20), $chroma: 0.01, $space: oklch)} + +<===> modern/to_modern/output.css +a { + b: lab(49.8635566117% 11.8934236813 -23.2342925555); +} + +<===> +================================================================================ +<===> powerless/legacy/input.scss +@use "sass:color"; +a {b: color.adjust(hsl(0deg 0% 50%), $space: lab)} + +<===> powerless/legacy/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> +================================================================================ +<===> powerless/modern/input.scss +@use "sass:color"; +a {b: color.adjust(oklch(50% 0 0deg), $space: lab)} + +<===> powerless/modern/output.css +a { + b: oklch(50% 0 none); +} + +<===> +================================================================================ +<===> missing/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.adjust(rgb(none none none))} + +<===> missing/legacy/same/implicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> missing/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.adjust(rgb(none none none), $space: rgb)} + +<===> missing/legacy/same/explicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> missing/legacy/analogous/legacy/input.scss +@use "sass:color"; +a {b: color.adjust(hsl(none 50% 50%), $space: hwb)} + +<===> missing/legacy/analogous/legacy/output.css +a { + b: hsl(0, 50%, 50%); +} + +<===> +================================================================================ +<===> missing/legacy/analogous/modern/input.scss +@use "sass:color"; +a {b: color.adjust(rgb(none none none), $space: display-p3)} + +<===> missing/legacy/analogous/modern/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> missing/modern/same/implicit/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb none none none))} + +<===> missing/modern/same/implicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> missing/modern/same/explicit/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb none none none), $space: srgb)} + +<===> missing/modern/same/explicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> missing/modern/analogous/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb none none none), $space: display-p3)} + +<===> missing/modern/analogous/output.css +a { + b: color(srgb none none none); +} diff --git a/spec/core_functions/color/adjust/srgb.hrx b/spec/core_functions/color/adjust/srgb.hrx new file mode 100644 index 0000000000..285ebfe6fb --- /dev/null +++ b/spec/core_functions/color/adjust/srgb.hrx @@ -0,0 +1,228 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(srgb 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: -10%)} + +<===> red/percent/output.css +a { + b: color(srgb 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: 0.9)} + +<===> red/above_max/output.css +a { + b: color(srgb 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: -0.3)} + +<===> red/below_min/output.css +a { + b: color(srgb -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: 1.9)} + +<===> red/arg_above_max/output.css +a { + b: color(srgb 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: -1.3)} + +<===> red/arg_below_min/output.css +a { + b: color(srgb -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: -0.3)} + +<===> green/unitless/output.css +a { + b: color(srgb 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(srgb 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> green/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: 0.7)} + +<===> green/above_max/output.css +a { + b: color(srgb 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> green/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: -0.8)} + +<===> green/below_min/output.css +a { + b: color(srgb 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> green/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: 1.7)} + +<===> green/arg_above_max/output.css +a { + b: color(srgb 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> green/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $green: -1.8)} + +<===> green/arg_below_min/output.css +a { + b: color(srgb 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: -0.3)} + +<===> blue/unitless/output.css +a { + b: color(srgb 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: 20%)} + +<===> blue/percent/output.css +a { + b: color(srgb 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> blue/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: 0.7)} + +<===> blue/above_max/output.css +a { + b: color(srgb 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> blue/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: -0.8)} + +<===> blue/below_min/output.css +a { + b: color(srgb 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> blue/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: 1.7)} + +<===> blue/arg_above_max/output.css +a { + b: color(srgb 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> blue/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $blue: -1.8)} + +<===> blue/arg_below_min/output.css +a { + b: color(srgb 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: 0.3, $green: 0.2, $blue: 0.1)} + +<===> all/output.css +a { + b: color(srgb 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(srgb 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb 0.2 0.5 0.7), $red: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(srgb 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust/srgb_linear.hrx b/spec/core_functions/color/adjust/srgb_linear.hrx new file mode 100644 index 0000000000..529aa22441 --- /dev/null +++ b/spec/core_functions/color/adjust/srgb_linear.hrx @@ -0,0 +1,228 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(srgb-linear 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: -10%)} + +<===> red/percent/output.css +a { + b: color(srgb-linear 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: 0.9)} + +<===> red/above_max/output.css +a { + b: color(srgb-linear 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: -0.3)} + +<===> red/below_min/output.css +a { + b: color(srgb-linear -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: 1.9)} + +<===> red/arg_above_max/output.css +a { + b: color(srgb-linear 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: -1.3)} + +<===> red/arg_below_min/output.css +a { + b: color(srgb-linear -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: -0.3)} + +<===> green/unitless/output.css +a { + b: color(srgb-linear 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(srgb-linear 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> green/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: 0.7)} + +<===> green/above_max/output.css +a { + b: color(srgb-linear 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> green/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: -0.8)} + +<===> green/below_min/output.css +a { + b: color(srgb-linear 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> green/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: 1.7)} + +<===> green/arg_above_max/output.css +a { + b: color(srgb-linear 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> green/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $green: -1.8)} + +<===> green/arg_below_min/output.css +a { + b: color(srgb-linear 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: -0.3)} + +<===> blue/unitless/output.css +a { + b: color(srgb-linear 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: 20%)} + +<===> blue/percent/output.css +a { + b: color(srgb-linear 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> blue/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: 0.7)} + +<===> blue/above_max/output.css +a { + b: color(srgb-linear 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> blue/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: -0.8)} + +<===> blue/below_min/output.css +a { + b: color(srgb-linear 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> blue/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: 1.7)} + +<===> blue/arg_above_max/output.css +a { + b: color(srgb-linear 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> blue/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $blue: -1.8)} + +<===> blue/arg_below_min/output.css +a { + b: color(srgb-linear 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: 0.3, $green: 0.2, $blue: 0.1)} + +<===> all/output.css +a { + b: color(srgb-linear 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(srgb-linear 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(srgb-linear 0.2 0.5 0.7), $red: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(srgb-linear 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust_color/units.hrx b/spec/core_functions/color/adjust/units.hrx similarity index 97% rename from spec/core_functions/color/adjust_color/units.hrx rename to spec/core_functions/color/adjust/units.hrx index 605d84767d..1de839cbad 100644 --- a/spec/core_functions/color/adjust_color/units.hrx +++ b/spec/core_functions/color/adjust/units.hrx @@ -50,7 +50,7 @@ a {b: color.adjust(red, $hue: 60rad)} <===> hue/angle/output.css a { - b: #00b4ff; + b: rgb(0, 179.576224164, 255); } <===> @@ -61,7 +61,7 @@ a {b: color.adjust(red, $saturation: -10%)} <===> saturation/percent/output.css a { - b: #f20d0d; + b: rgb(242.25, 12.75, 12.75); } <===> @@ -72,7 +72,7 @@ a {b: color.adjust(red, $saturation: -10)} <===> saturation/unitless/output.css a { - b: #f20d0d; + b: rgb(242.25, 12.75, 12.75); } <===> saturation/unitless/warning @@ -96,7 +96,7 @@ a {b: color.adjust(red, $saturation: -10in)} <===> saturation/unknown/output.css a { - b: #f20d0d; + b: rgb(242.25, 12.75, 12.75); } <===> saturation/unknown/warning diff --git a/spec/core_functions/color/adjust/xyz_d50.hrx b/spec/core_functions/color/adjust/xyz_d50.hrx new file mode 100644 index 0000000000..38e6db87d6 --- /dev/null +++ b/spec/core_functions/color/adjust/xyz_d50.hrx @@ -0,0 +1,228 @@ +<===> x/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: 0.5)} + +<===> x/unitless/output.css +a { + b: color(xyz-d50 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> x/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: -10%)} + +<===> x/percent/output.css +a { + b: color(xyz-d50 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: 0.9)} + +<===> x/above_max/output.css +a { + b: color(xyz-d50 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: -0.3)} + +<===> x/below_min/output.css +a { + b: color(xyz-d50 -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: 1.9)} + +<===> x/arg_above_max/output.css +a { + b: color(xyz-d50 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: -1.3)} + +<===> x/arg_below_min/output.css +a { + b: color(xyz-d50 -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> y/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: -0.3)} + +<===> y/unitless/output.css +a { + b: color(xyz-d50 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> y/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: 40%)} + +<===> y/percent/output.css +a { + b: color(xyz-d50 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> y/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: 0.7)} + +<===> y/above_max/output.css +a { + b: color(xyz-d50 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> y/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: -0.8)} + +<===> y/below_min/output.css +a { + b: color(xyz-d50 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> y/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: 1.7)} + +<===> y/arg_above_max/output.css +a { + b: color(xyz-d50 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> y/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $y: -1.8)} + +<===> y/arg_below_min/output.css +a { + b: color(xyz-d50 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> z/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: -0.3)} + +<===> z/unitless/output.css +a { + b: color(xyz-d50 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> z/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: 20%)} + +<===> z/percent/output.css +a { + b: color(xyz-d50 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> z/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: 0.7)} + +<===> z/above_max/output.css +a { + b: color(xyz-d50 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> z/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: -0.8)} + +<===> z/below_min/output.css +a { + b: color(xyz-d50 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> z/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: 1.7)} + +<===> z/arg_above_max/output.css +a { + b: color(xyz-d50 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> z/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $z: -1.8)} + +<===> z/arg_below_min/output.css +a { + b: color(xyz-d50 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: 0.3, $y: 0.2, $z: 0.1)} + +<===> all/output.css +a { + b: color(xyz-d50 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7 / 0.9), $x: 0.5)} + +<===> alpha_input/output.css +a { + b: color(xyz-d50 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d50 0.2 0.5 0.7), $x: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(xyz-d50 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust/xyz_d65.hrx b/spec/core_functions/color/adjust/xyz_d65.hrx new file mode 100644 index 0000000000..fcab7a2b36 --- /dev/null +++ b/spec/core_functions/color/adjust/xyz_d65.hrx @@ -0,0 +1,228 @@ +<===> x/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: 0.5)} + +<===> x/unitless/output.css +a { + b: color(xyz 0.7 0.5 0.7); +} + +<===> +================================================================================ +<===> x/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: -10%)} + +<===> x/percent/output.css +a { + b: color(xyz 0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: 0.9)} + +<===> x/above_max/output.css +a { + b: color(xyz 1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: -0.3)} + +<===> x/below_min/output.css +a { + b: color(xyz -0.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: 1.9)} + +<===> x/arg_above_max/output.css +a { + b: color(xyz 2.1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: -1.3)} + +<===> x/arg_below_min/output.css +a { + b: color(xyz -1.1 0.5 0.7); +} + +<===> +================================================================================ +<===> y/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $y: -0.3)} + +<===> y/unitless/output.css +a { + b: color(xyz 0.2 0.2 0.7); +} + +<===> +================================================================================ +<===> y/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $y: 40%)} + +<===> y/percent/output.css +a { + b: color(xyz 0.2 0.9 0.7); +} + +<===> +================================================================================ +<===> y/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $y: 0.7)} + +<===> y/above_max/output.css +a { + b: color(xyz 0.2 1.2 0.7); +} + +<===> +================================================================================ +<===> y/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $y: -0.8)} + +<===> y/below_min/output.css +a { + b: color(xyz 0.2 -0.3 0.7); +} + +<===> +================================================================================ +<===> y/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $y: 1.7)} + +<===> y/arg_above_max/output.css +a { + b: color(xyz 0.2 2.2 0.7); +} + +<===> +================================================================================ +<===> y/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $y: -1.8)} + +<===> y/arg_below_min/output.css +a { + b: color(xyz 0.2 -1.3 0.7); +} + +<===> +================================================================================ +<===> z/unitless/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $z: -0.3)} + +<===> z/unitless/output.css +a { + b: color(xyz 0.2 0.5 0.4); +} + +<===> +================================================================================ +<===> z/percent/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $z: 20%)} + +<===> z/percent/output.css +a { + b: color(xyz 0.2 0.5 0.9); +} + +<===> +================================================================================ +<===> z/above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $z: 0.7)} + +<===> z/above_max/output.css +a { + b: color(xyz 0.2 0.5 1.4); +} + +<===> +================================================================================ +<===> z/below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $z: -0.8)} + +<===> z/below_min/output.css +a { + b: color(xyz 0.2 0.5 -0.1); +} + +<===> +================================================================================ +<===> z/arg_above_max/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $z: 1.7)} + +<===> z/arg_above_max/output.css +a { + b: color(xyz 0.2 0.5 2.4); +} + +<===> +================================================================================ +<===> z/arg_below_min/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $z: -1.8)} + +<===> z/arg_below_min/output.css +a { + b: color(xyz 0.2 0.5 -1.1); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: 0.3, $y: 0.2, $z: 0.1)} + +<===> all/output.css +a { + b: color(xyz 0.5 0.7 0.8); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7 / 0.9), $x: 0.5)} + +<===> alpha_input/output.css +a { + b: color(xyz 0.7 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.adjust(color(xyz-d65 0.2 0.5 0.7), $x: 0.5, $alpha: -0.1)} + +<===> alpha_arg/output.css +a { + b: color(xyz 0.7 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/adjust_color/error/bounds.hrx b/spec/core_functions/color/adjust_color/error/bounds.hrx deleted file mode 100644 index be6e0e1bbf..0000000000 --- a/spec/core_functions/color/adjust_color/error/bounds.hrx +++ /dev/null @@ -1,353 +0,0 @@ -<===> red/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(red, $red: -256)} - -<===> red/too_low/error -Error: $red: Expected -256 to be within -255 and 255. - , -2 | a {b: color.adjust(red, $red: -256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> red/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(red, $red: 256)} - -<===> red/too_high/error -Error: $red: Expected 256 to be within -255 and 255. - , -2 | a {b: color.adjust(red, $red: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> red/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.adjust(red, $red: 300px)} - -<===> red/unit/error -Error: $red: Expected 300px to be within -255 and 255. - , -4 | a {b: color.adjust(red, $red: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> green/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(green, $green: -256)} - -<===> green/too_low/error -Error: $green: Expected -256 to be within -255 and 255. - , -2 | a {b: color.adjust(green, $green: -256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> green/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(green, $green: 256)} - -<===> green/too_high/error -Error: $green: Expected 256 to be within -255 and 255. - , -2 | a {b: color.adjust(green, $green: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> green/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.adjust(green, $green: 300px)} - -<===> green/unit/error -Error: $green: Expected 300px to be within -255 and 255. - , -4 | a {b: color.adjust(green, $green: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(blue, $blue: -256)} - -<===> blue/too_low/error -Error: $blue: Expected -256 to be within -255 and 255. - , -2 | a {b: color.adjust(blue, $blue: -256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(blue, $blue: 256)} - -<===> blue/too_high/error -Error: $blue: Expected 256 to be within -255 and 255. - , -2 | a {b: color.adjust(blue, $blue: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blue/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.adjust(blue, $blue: 300px)} - -<===> blue/unit/error -Error: $blue: Expected 300px to be within -255 and 255. - , -4 | a {b: color.adjust(blue, $blue: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(red, $saturation: -100.001%)} - -<===> saturation/too_low/error -Error: $saturation: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $saturation: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(red, $saturation: 100.001%)} - -<===> saturation/too_high/error -Error: $saturation: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $saturation: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> saturation/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.adjust(red, $saturation: 200px)} - -<===> saturation/unit/error -DEPRECATION WARNING: $saturation: Passing a number without unit % (200px) is deprecated. - -To preserve current behavior: calc($saturation / 1px * 1%) - -More info: https://sass-lang.com/d/function-units - - , -4 | a {b: color.adjust(red, $saturation: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -Error: $saturation: Expected 200px to be within -100% and 100%. - , -4 | a {b: color.adjust(red, $saturation: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(red, $lightness: -100.001%)} - -<===> lightness/too_low/error -Error: $lightness: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $lightness: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(red, $lightness: 100.001%)} - -<===> lightness/too_high/error -Error: $lightness: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $lightness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.adjust(red, $lightness: 200px)} - -<===> lightness/unit/error -DEPRECATION WARNING: $lightness: Passing a number without unit % (200px) is deprecated. - -To preserve current behavior: calc($lightness / 1px * 1%) - -More info: https://sass-lang.com/d/function-units - - , -4 | a {b: color.adjust(red, $lightness: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -Error: $lightness: Expected 200px to be within -100% and 100%. - , -4 | a {b: color.adjust(red, $lightness: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(red, $alpha: -1.001)} - -<===> alpha/too_low/error -Error: $alpha: Expected -1.001 to be within -1 and 1. - , -2 | a {b: color.adjust(red, $alpha: -1.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(red, $alpha: 1.001)} - -<===> alpha/too_high/error -Error: $alpha: Expected 1.001 to be within -1 and 1. - , -2 | a {b: color.adjust(red, $alpha: 1.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.adjust(red, $alpha: 50%)} - -<===> alpha/unit/error -DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. - -To preserve current behavior: calc($alpha / 1%) - -More info: https://sass-lang.com/d/function-units - - , -4 | a {b: color.adjust(red, $alpha: 50%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -Error: $alpha: Expected 50% to be within -1 and 1. - , -4 | a {b: color.adjust(red, $alpha: 50%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(red, $blackness: -100.001%)} - -<===> blackness/too_low/error -Error: $blackness: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $blackness: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(red, $blackness: 100.001%)} - -<===> blackness/too_high/error -Error: $blackness: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $blackness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_low/input.scss -@use "sass:color"; -a {b: color.adjust(red, $whiteness: -100.001%)} - -<===> whiteness/too_low/error -Error: $whiteness: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $whiteness: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_high/input.scss -@use "sass:color"; -a {b: color.adjust(red, $whiteness: 100.001%)} - -<===> whiteness/too_high/error -Error: $whiteness: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.adjust(red, $whiteness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_hue.hrx b/spec/core_functions/color/adjust_hue.hrx new file mode 100644 index 0000000000..a97d14f1f2 --- /dev/null +++ b/spec/core_functions/color/adjust_hue.hrx @@ -0,0 +1,358 @@ +<===> max/input.scss +a {b: adjust-hue(red, 359)} + +<===> max/output.css +a { + b: rgb(255, 0, 4.25); +} + +<===> max/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 359deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 359)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> above_max/input.scss +a {b: adjust-hue(red, 540)} + +<===> above_max/output.css +a { + b: aqua; +} + +<===> above_max/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 540deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 540)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> min/input.scss +a {b: adjust-hue(blue, 0)} + +<===> min/output.css +a { + b: blue; +} + +<===> min/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 0deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(blue, 0)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> negative/input.scss +a {b: adjust-hue(red, -180)} + +<===> negative/output.css +a { + b: aqua; +} + +<===> negative/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: -180deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, -180)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> middle/input.scss +a {b: adjust-hue(red, 123)} + +<===> middle/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> middle/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 123deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 123)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> fraction/input.scss +a {b: adjust-hue(red, 0.5)} + +<===> fraction/output.css +a { + b: rgb(255, 2.125, 0); +} + +<===> fraction/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 0.5deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/input.scss +a {b: adjust-hue(rgba(red, 0.1), 359)} + +<===> alpha/output.css +a { + b: rgba(255, 0, 4.25, 0.1); +} + +<===> alpha/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 359deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(rgba(red, 0.1), 359)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> units/deg/input.scss +a {b: adjust-hue(red, 60deg)} + +<===> units/deg/output.css +a { + b: yellow; +} + +<===> units/deg/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 60deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 60deg)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> units/unitless/input.scss +a {b: adjust-hue(red, 60)} + +<===> units/unitless/output.css +a { + b: yellow; +} + +<===> units/unitless/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 60deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 60)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> units/unknown/input.scss +a {b: adjust-hue(red, 60in)} + +<===> units/unknown/output.css +a { + b: yellow; +} + +<===> units/unknown/warning +DEPRECATION WARNING: $degrees: Passing a unit other than deg (60in) is deprecated. + +To preserve current behavior: calc($degrees / 1in) + +See https://sass-lang.com/d/function-units + + , +1 | a {b: adjust-hue(red, 60in)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 60deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 60in)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> units/angle/input.scss +a {b: adjust-hue(red, 60rad)} + +<===> units/angle/output.css +a { + b: rgb(0, 179.576224164, 255); +} + +<===> units/angle/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 3437.7467707849deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue(red, 60rad)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +a {b: adjust-hue($color: red, $degrees: 123)} + +<===> named/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> named/warning +DEPRECATION WARNING: adjust-hue() is deprecated. Suggestion: + +color.adjust($color, $hue: 123deg) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: adjust-hue($color: red, $degrees: 123)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_few_args/input.scss +a {b: adjust-hue(red)} + +<===> error/too_few_args/error +Error: Missing argument $degrees. + ,--> input.scss +1 | a {b: adjust-hue(red)} + | ^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function adjust-hue($color, $degrees) { + | ============================ declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: adjust-hue(red, 1, 2)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +1 | a {b: adjust-hue(red, 1, 2)} + | ^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function adjust-hue($color, $degrees) { + | ============================ declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color/input.scss +a {b: adjust-hue(1, 2)} + +<===> error/type/color/error +Error: $color: 1 is not a color. + , +1 | a {b: adjust-hue(1, 2)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/hue/input.scss +a {b: adjust-hue(red, blue)} + +<===> error/type/hue/error +Error: $degrees: blue is not a number. + , +1 | a {b: adjust-hue(red, blue)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +a {b: adjust-hue(lch(0% 0 0deg), 10deg)} + +<===> error/non_legacy/error +Error: adjust-hue() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument. + , +1 | a {b: adjust-hue(lch(0% 0 0deg), 10deg)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/alpha.hrx b/spec/core_functions/color/alpha.hrx index f27dc60fd1..d0f9330037 100644 --- a/spec/core_functions/color/alpha.hrx +++ b/spec/core_functions/color/alpha.hrx @@ -256,7 +256,7 @@ Error: $color: 1 is not a color. <===> ================================================================================ <===> error/with_module/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.opacity(var(--c))} <===> error/with_module/type/error @@ -309,3 +309,17 @@ Error: $color: 1=c is not a color. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.alpha(color(srgb 1 1 1))} + +<===> error/non_legacy/error +Error: color.alpha() is only supported for legacy colors. Please use color.channel() instead. + , +2 | a {b: color.alpha(color(srgb 1 1 1))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/blackness.hrx b/spec/core_functions/color/blackness.hrx index 5639a40274..c67e3aa6ef 100644 --- a/spec/core_functions/color/blackness.hrx +++ b/spec/core_functions/color/blackness.hrx @@ -1,5 +1,5 @@ <===> max/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.blackness(black)} <===> max/output.css @@ -7,10 +7,23 @@ a { b: 100%; } +<===> max/warning +DEPRECATION WARNING: color.blackness() is deprecated. Suggestion: + +color.channel($color, blackness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blackness(black)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.blackness(white)} <===> min/output.css @@ -18,65 +31,143 @@ a { b: 0%; } +<===> min/warning +DEPRECATION WARNING: color.blackness() is deprecated. Suggestion: + +color.channel($color, blackness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blackness(white)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/zero_whiteness/input.scss -@use 'sass:color'; -a {b: color.blackness(color.hwb(0, 0%, 50%))} +@use "sass:color"; +a {b: color.blackness(hwb(0 0% 50%))} <===> middle/zero_whiteness/output.css a { - b: 49.8039215686%; + b: 50%; } +<===> middle/zero_whiteness/warning +DEPRECATION WARNING: color.blackness() is deprecated. Suggestion: + +color.channel($color, blackness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blackness(hwb(0 0% 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/half_whiteness/input.scss -@use 'sass:color'; -a {b: color.blackness(color.hwb(0, 50%, 50%))} +@use "sass:color"; +a {b: color.blackness(hwb(0 50% 50%))} <===> middle/half_whiteness/output.css a { - b: 49.8039215686%; + b: 50%; } +<===> middle/half_whiteness/warning +DEPRECATION WARNING: color.blackness() is deprecated. Suggestion: + +color.channel($color, blackness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blackness(hwb(0 50% 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/high_whiteness/input.scss -@use 'sass:color'; -a {b: color.blackness(color.hwb(0, 70%, 70%))} +@use "sass:color"; +a {b: color.blackness(hwb(0 70% 70%))} <===> middle/high_whiteness/output.css a { - b: 49.8039215686%; + b: 50%; } +<===> middle/high_whiteness/warning +DEPRECATION WARNING: color.blackness() is deprecated. Suggestion: + +color.channel($color, blackness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blackness(hwb(0 70% 70%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> fraction/input.scss -@use 'sass:color'; -a {b: color.blackness(color.hwb(0, 0%, 0.5%))} +@use "sass:color"; +a {b: color.blackness(hwb(0 0% 0.5%))} <===> fraction/output.css a { - b: 0.3921568627%; + b: 0.5%; } +<===> fraction/warning +DEPRECATION WARNING: color.blackness() is deprecated. Suggestion: + +color.channel($color, blackness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blackness(hwb(0 0% 0.5%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss -@use 'sass:color'; -a {b: color.blackness($color: color.hwb(0, 0%, 42%))} +@use "sass:color"; +a {b: color.blackness($color: hwb(0 0% 42%))} <===> named/output.css a { - b: 41.9607843137%; + b: 42%; } +<===> named/warning +DEPRECATION WARNING: color.blackness() is deprecated. Suggestion: + +color.channel($color, blackness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blackness($color: hwb(0 0% 42%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.blackness()} <===> error/too_few_args/error @@ -94,7 +185,7 @@ Error: Missing argument $color. <===> ================================================================================ <===> error/too_many_args/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.blackness(red, green)} <===> error/too_many_args/error @@ -112,7 +203,7 @@ Error: Only 1 argument allowed, but 2 were passed. <===> ================================================================================ <===> error/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.blackness(1)} <===> error/type/error @@ -122,3 +213,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.blackness(color(srgb 1 1 1))} + +<===> error/non_legacy/error +Error: color.blackness() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.blackness(color(srgb 1 1 1))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/blue.hrx b/spec/core_functions/color/blue.hrx index d5dcddad28..10793761d7 100644 --- a/spec/core_functions/color/blue.hrx +++ b/spec/core_functions/color/blue.hrx @@ -7,6 +7,19 @@ a { b: 255; } +<===> max/warning +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blue(rgb(0, 0, 255))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss @@ -18,6 +31,19 @@ a { b: 0; } +<===> min/warning +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blue(rgb(0, 0, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/input.scss @@ -29,6 +55,19 @@ a { b: 123; } +<===> middle/warning +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blue(rgb(0, 0, 123))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss @@ -40,6 +79,19 @@ a { b: 234; } +<===> named/warning +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blue($color: rgb(0, 0, 234))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -89,3 +141,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.blue(color(srgb 1 1 1))} + +<===> error/non_legacy/error +Error: color.blue() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.blue(color(srgb 1 1 1))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/a98_rgb.hrx b/spec/core_functions/color/change/a98_rgb.hrx new file mode 100644 index 0000000000..fb38e635a8 --- /dev/null +++ b/spec/core_functions/color/change/a98_rgb.hrx @@ -0,0 +1,162 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(a98-rgb 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/none/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: none)} + +<===> red/none/output.css +a { + b: color(a98-rgb none 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(a98-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(a98-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(a98-rgb 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> green/none/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: none)} + +<===> green/none/output.css +a { + b: color(a98-rgb 0.2 none 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(a98-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(a98-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(a98-rgb 0.2 0.5 100); +} + +<===> +================================================================================ +<===> blue/none/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: none)} + +<===> blue/none/output.css +a { + b: color(a98-rgb 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(a98-rgb 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/display_p3.hrx b/spec/core_functions/color/change/display_p3.hrx new file mode 100644 index 0000000000..9a0779113d --- /dev/null +++ b/spec/core_functions/color/change/display_p3.hrx @@ -0,0 +1,162 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(display-p3 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(display-p3 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(display-p3 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/none/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: none)} + +<===> red/none/output.css +a { + b: color(display-p3 none 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(display-p3 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(display-p3 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(display-p3 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> green/none/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: none)} + +<===> green/none/output.css +a { + b: color(display-p3 0.2 none 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(display-p3 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(display-p3 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(display-p3 0.2 0.5 100); +} + +<===> +================================================================================ +<===> blue/none/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: none)} + +<===> blue/none/output.css +a { + b: color(display-p3 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(display-p3 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(display-p3 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(display-p3 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change_color/error/args.hrx b/spec/core_functions/color/change/error/args.hrx similarity index 95% rename from spec/core_functions/color/change_color/error/args.hrx rename to spec/core_functions/color/change/error/args.hrx index 0846f14812..15360eec48 100644 --- a/spec/core_functions/color/change_color/error/args.hrx +++ b/spec/core_functions/color/change/error/args.hrx @@ -35,7 +35,7 @@ Error: Only one positional argument is allowed. All other arguments must be pass a {b: color.change(red, $ambience: 10%)} <===> unknown/error -Error: No argument named $ambience. +Error: $ambience: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.change(red, $ambience: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/change/error/bounds.hrx b/spec/core_functions/color/change/error/bounds.hrx new file mode 100644 index 0000000000..cc04390c61 --- /dev/null +++ b/spec/core_functions/color/change/error/bounds.hrx @@ -0,0 +1,39 @@ +<===> alpha/too_low/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: -0.001)} + +<===> alpha/too_low/error +Error: $alpha: Expected -0.001 to be within 0 and 1. + , +2 | a {b: color.change(red, $alpha: -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/too_high/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: 1.001)} + +<===> alpha/too_high/error +Error: $alpha: Expected 1.001 to be within 0 and 1. + , +2 | a {b: color.change(red, $alpha: 1.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/unit/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: 150%)} + +<===> alpha/unit/error +Error: $alpha: Expected 150% to be within 0% and 100%. + , +2 | a {b: color.change(red, $alpha: 150%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/incompatible_channel.hrx b/spec/core_functions/color/change/error/incompatible_channel.hrx new file mode 100644 index 0000000000..b989f771a0 --- /dev/null +++ b/spec/core_functions/color/change/error/incompatible_channel.hrx @@ -0,0 +1,39 @@ +<===> legacy_space/input.scss +@use "sass:color"; +a {b: color.change(red, $chroma: 50%)} + +<===> legacy_space/error +Error: $chroma: Color space rgb doesn't have a channel with this name. + , +2 | a {b: color.change(red, $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> legacy_channel/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + +<===> legacy_channel/error +Error: $whiteness: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern_both/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + +<===> modern_both/error +Error: $chroma: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/mixed_formats.hrx b/spec/core_functions/color/change/error/mixed_formats.hrx similarity index 83% rename from spec/core_functions/color/change_color/error/mixed_formats.hrx rename to spec/core_functions/color/change/error/mixed_formats.hrx index 46b938a4a4..ed7227f182 100644 --- a/spec/core_functions/color/change_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/change/error/mixed_formats.hrx @@ -3,7 +3,7 @@ a {b: color.change(red, $red: 1, $hue: 1)} <===> red_and_hue/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $hue: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.change(red, $red: 1, $hue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.change(red, $green: 1, $saturation: 1%)} <===> green_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.change(red, $green: 1, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.change(red, $blue: 1, $lightness: 1%)} <===> blue_and_lightness/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $lightness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.change(red, $blue: 1, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.change(red, $red: 1, $blackness: 1%)} <===> red_and_blackness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $blackness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.change(red, $red: 1, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: color.change(red, $green: 1, $whiteness: 1%)} <===> green_and_whiteness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.change(red, $green: 1, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: color.change(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $blackness: Color space hsl doesn't have a channel with this name. , 2 | a {b: color.change(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -87,7 +87,7 @@ Error: HSL parameters may not be passed along with HWB parameters. a {b: color.change(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space hsl doesn't have a channel with this name. , 2 | a {b: color.change(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/change/error/space.hrx b/spec/core_functions/color/change/error/space.hrx new file mode 100644 index 0000000000..d2431675ad --- /dev/null +++ b/spec/core_functions/color/change/error/space.hrx @@ -0,0 +1,25 @@ +<===> unknown/input.scss +@use "sass:color"; +a {b: color.change(red, $space: c)} + +<===> unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.change(red, $space: c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> quoted/input.scss +@use "sass:color"; +a {b: color.change(red, $space: "lab")} + +<===> quoted/error +Error: $space: Expected "lab" to be an unquoted string. + , +2 | a {b: color.change(red, $space: "lab")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/type.hrx b/spec/core_functions/color/change/error/type.hrx similarity index 71% rename from spec/core_functions/color/change_color/error/type.hrx rename to spec/core_functions/color/change/error/type.hrx index e48fbc42f4..d421de68a6 100644 --- a/spec/core_functions/color/change_color/error/type.hrx +++ b/spec/core_functions/color/change/error/type.hrx @@ -17,7 +17,7 @@ Error: $color: 1 is not a color. a {b: color.change(red, $red: c)} <===> red/error -Error: $red: c is not a number. +Error: $red: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $red: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ Error: $red: c is not a number. a {b: color.change(red, $green: c)} <===> green/error -Error: $green: c is not a number. +Error: $green: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $green: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ Error: $green: c is not a number. a {b: color.change(red, $blue: c)} <===> blue/error -Error: $blue: c is not a number. +Error: $blue: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $blue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ Error: $blue: c is not a number. a {b: color.change(red, $hue: c)} <===> hue/error -Error: $hue: c is not a number. +Error: $hue: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $hue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ Error: $hue: c is not a number. a {b: color.change(red, $saturation: c)} <===> saturation/error -Error: $saturation: c is not a number. +Error: $saturation: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $saturation: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -87,7 +87,7 @@ Error: $saturation: c is not a number. a {b: color.change(red, $lightness: c)} <===> lightness/error -Error: $lightness: c is not a number. +Error: $lightness: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $lightness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -101,13 +101,27 @@ Error: $lightness: c is not a number. a {b: color.change(red, $alpha: c)} <===> alpha/error -Error: $alpha: c is not a number. +Error: $alpha: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $alpha: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet +<===> +================================================================================ +<===> quoted_none/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: "none")} + +<===> quoted_none/error +Error: $alpha: "none" is not a number or unquoted "none". + , +2 | a {b: color.change(red, $alpha: "none")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> blackness/input.scss @@ -115,7 +129,7 @@ Error: $alpha: c is not a number. a {b: color.change(red, $blackness: c)} <===> blackness/error -Error: $blackness: c is not a number. +Error: $blackness: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $blackness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -129,9 +143,23 @@ Error: $blackness: c is not a number. a {b: color.change(red, $whiteness: c)} <===> whiteness/error -Error: $whiteness: c is not a number. +Error: $whiteness: c is not a number or unquoted "none". , 2 | a {b: color.change(red, $whiteness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/input.scss +@use "sass:color"; +a {b: color.change(red, $space: 1)} + +<===> space/error +Error: $space: 1 is not a string. + , +2 | a {b: color.change(red, $space: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/a98_rgb.hrx b/spec/core_functions/color/change/error/units/a98_rgb.hrx new file mode 100644 index 0000000000..0a2553a7ec --- /dev/null +++ b/spec/core_functions/color/change/error/units/a98_rgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/display_p3.hrx b/spec/core_functions/color/change/error/units/display_p3.hrx new file mode 100644 index 0000000000..4df0277296 --- /dev/null +++ b/spec/core_functions/color/change/error/units/display_p3.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/units.hrx b/spec/core_functions/color/change/error/units/hwb.hrx similarity index 100% rename from spec/core_functions/color/change_color/error/units.hrx rename to spec/core_functions/color/change/error/units/hwb.hrx diff --git a/spec/core_functions/color/change/error/units/lab.hrx b/spec/core_functions/color/change/error/units/lab.hrx new file mode 100644 index 0000000000..b292514712 --- /dev/null +++ b/spec/core_functions/color/change/error/units/lab.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 30 -50), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.change(lab(50% 30 -50), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> a/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 30 -50), $a: 20px)} + +<===> a/error +Error: $a: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.change(lab(50% 30 -50), $a: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> b/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 30 -50), $b: 20px)} + +<===> b/error +Error: $b: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.change(lab(50% 30 -50), $b: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/lch.hrx b/spec/core_functions/color/change/error/units/lch.hrx new file mode 100644 index 0000000000..296fd9ecff --- /dev/null +++ b/spec/core_functions/color/change/error/units/lch.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 30 50deg), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.change(lch(50% 30 50deg), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> chroma/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 30 50deg), $chroma: 20px)} + +<===> chroma/error +Error: $chroma: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.change(lch(50% 30 50deg), $chroma: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> hue/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 30 50deg), $hue: 20%)} + +<===> hue/error +Error: $hue: Expected 20% to have an angle unit (deg, grad, rad, turn). + , +2 | a {b: color.change(lch(50% 30 50deg), $hue: 20%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/oklab.hrx b/spec/core_functions/color/change/error/units/oklab.hrx new file mode 100644 index 0000000000..1415ccbe80 --- /dev/null +++ b/spec/core_functions/color/change/error/units/oklab.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 0.3px)} + +<===> lightness/error +Error: $lightness: Expected 0.3px to have unit "%" or no units. + , +2 | a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 0.3px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> a/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $a: 0.2px)} + +<===> a/error +Error: $a: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.change(oklab(50% 0.2 -0.3), $a: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> b/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $b: 0.2px)} + +<===> b/error +Error: $b: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.change(oklab(50% 0.2 -0.3), $b: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/oklch.hrx b/spec/core_functions/color/change/error/units/oklch.hrx new file mode 100644 index 0000000000..66a5850478 --- /dev/null +++ b/spec/core_functions/color/change/error/units/oklch.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.3 50deg), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.change(oklch(50% 0.3 50deg), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> chroma/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.3 50deg), $chroma: 0.2px)} + +<===> chroma/error +Error: $chroma: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.change(oklch(50% 0.3 50deg), $chroma: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> hue/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.3 50deg), $hue: 20%)} + +<===> hue/error +Error: $hue: Expected 20% to have an angle unit (deg, grad, rad, turn). + , +2 | a {b: color.change(oklch(50% 0.3 50deg), $hue: 20%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/prophoto_rgb.hrx b/spec/core_functions/color/change/error/units/prophoto_rgb.hrx new file mode 100644 index 0000000000..9f119dc18e --- /dev/null +++ b/spec/core_functions/color/change/error/units/prophoto_rgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/rec2020.hrx b/spec/core_functions/color/change/error/units/rec2020.hrx new file mode 100644 index 0000000000..3b0f5249ce --- /dev/null +++ b/spec/core_functions/color/change/error/units/rec2020.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/srgb.hrx b/spec/core_functions/color/change/error/units/srgb.hrx new file mode 100644 index 0000000000..00b3019aa5 --- /dev/null +++ b/spec/core_functions/color/change/error/units/srgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/srgb_linear.hrx b/spec/core_functions/color/change/error/units/srgb_linear.hrx new file mode 100644 index 0000000000..c8ac9202d7 --- /dev/null +++ b/spec/core_functions/color/change/error/units/srgb_linear.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/xyz.hrx b/spec/core_functions/color/change/error/units/xyz.hrx new file mode 100644 index 0000000000..f4dcd916b0 --- /dev/null +++ b/spec/core_functions/color/change/error/units/xyz.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5px)} + +<===> red/error +Error: $x: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 0.5px)} + +<===> green/error +Error: $y: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 0.5px)} + +<===> blue/error +Error: $z: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/xyz_d50.hrx b/spec/core_functions/color/change/error/units/xyz_d50.hrx new file mode 100644 index 0000000000..25b5a8478c --- /dev/null +++ b/spec/core_functions/color/change/error/units/xyz_d50.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5px)} + +<===> red/error +Error: $x: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 0.5px)} + +<===> green/error +Error: $y: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 0.5px)} + +<===> blue/error +Error: $z: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/global.hrx b/spec/core_functions/color/change/global.hrx new file mode 100644 index 0000000000..cf9f014dde --- /dev/null +++ b/spec/core_functions/color/change/global.hrx @@ -0,0 +1,17 @@ +<===> legacy/input.scss +a {b: change-color(red, $blue: 50)} + +<===> legacy/output.css +a { + b: #ff0032; +} + +<===> +================================================================================ +<===> non_legacy/input.scss +a {b: change-color(pink, $chroma: 0.06, $space: oklch)} + +<===> non_legacy/output.css +a { + b: rgb(247.5333900768, 195.811523731, 204.5286989775); +} diff --git a/spec/core_functions/color/change/hsl.hrx b/spec/core_functions/color/change/hsl.hrx new file mode 100644 index 0000000000..b98d1969b0 --- /dev/null +++ b/spec/core_functions/color/change/hsl.hrx @@ -0,0 +1,458 @@ +<===> hue/max/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 359)} + +<===> hue/max/output.css +a { + b: rgb(255, 0, 4.25); +} + +<===> +================================================================================ +<===> hue/above_max/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 540)} + +<===> hue/above_max/output.css +a { + b: aqua; +} + +<===> +================================================================================ +<===> hue/min/input.scss +@use "sass:color"; +a {b: color.change(blue, $hue: 0)} + +<===> hue/min/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> hue/negative/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: -60)} + +<===> hue/negative/output.css +a { + b: fuchsia; +} + +<===> +================================================================================ +<===> hue/middle/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 123)} + +<===> hue/middle/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> +================================================================================ +<===> hue/fraction/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 0.5)} + +<===> hue/fraction/output.css +a { + b: rgb(255, 2.125, 0); +} + +<===> +================================================================================ +<===> hue/none/input.scss +@use "sass:color"; +a {b: color.change(hsl(0deg 100% 50%), $hue: none)} + +<===> hue/none/output.css +a { + b: hsl(none 100% 50%); +} + +<===> +================================================================================ +<===> saturation/max/input.scss +@use "sass:color"; +a {b: color.change(plum, $saturation: 100%)} + +<===> saturation/max/output.css +a { + b: #ff7eff; +} + +<===> +================================================================================ +<===> saturation/min/input.scss +@use "sass:color"; +a {b: color.change(plum, $saturation: 0%)} + +<===> saturation/min/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> +================================================================================ +<===> saturation/high/input.scss +@use "sass:color"; +a {b: color.change(plum, $saturation: 76%)} + +<===> saturation/high/output.css +a { + b: rgb(239.52, 141.48, 239.52); +} + +<===> +================================================================================ +<===> saturation/low/input.scss +@use "sass:color"; +a {b: color.change(plum, $saturation: 14%)} + +<===> saturation/low/output.css +a { + b: rgb(199.53, 181.47, 199.53); +} + +<===> +================================================================================ +<===> saturation/above_range/input.scss +@use "sass:color"; +a {b: color.change(plum, $saturation: 120%)} + +<===> saturation/above_range/output.css +a { + b: hsl(300, 120%, 74.7058823529%); +} + +<===> +================================================================================ +<===> saturation/below_range/input.scss +@use "sass:color"; +a {b: color.change(plum, $saturation: -20%)} + +<===> saturation/below_range/output.css +a { + b: rgb(177.6, 203.4, 177.6); +} + +<===> +================================================================================ +<===> saturation/none/input.scss +@use "sass:color"; +a {b: color.change(hsl(0deg 100% 50%), $saturation: none)} + +<===> saturation/none/output.css +a { + b: hsl(0deg none 50%); +} + +<===> +================================================================================ +<===> lightness/max/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 100%)} + +<===> lightness/max/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> lightness/fraction/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 0.5%)} + +<===> lightness/fraction/output.css +a { + b: rgb(2.55, 0, 0); +} + +<===> +================================================================================ +<===> lightness/min/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 0%)} + +<===> lightness/min/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> lightness/high/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 63%)} + +<===> lightness/high/output.css +a { + b: rgb(255, 66.3, 66.3); +} + +<===> +================================================================================ +<===> lightness/low/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 27%)} + +<===> lightness/low/output.css +a { + b: rgb(137.7, 0, 0); +} + +<===> +================================================================================ +<===> lightness/above_range/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 120%)} + +<===> lightness/above_range/output.css +a { + b: hsl(0, 100%, 120%); +} + +<===> +================================================================================ +<===> lightness/below_range/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: -20%)} + +<===> lightness/below_range/output.css +a { + b: hsl(0, 100%, -20%); +} + +<===> +================================================================================ +<===> lightness/none/input.scss +@use "sass:color"; +a {b: color.change(hsl(0deg 100% 50%), $lightness: none)} + +<===> lightness/none/output.css +a { + b: hsl(0deg 100% none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%)} + +<===> all/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} + +<===> alpha_input/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.7); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} + +<===> alpha_arg/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.7); +} + +<===> +================================================================================ +<===> units/hue/deg/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 60deg)} + +<===> units/hue/deg/output.css +a { + b: yellow; +} + +<===> +================================================================================ +<===> units/hue/unitless/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 60)} + +<===> units/hue/unitless/output.css +a { + b: yellow; +} + +<===> +================================================================================ +<===> units/hue/unknown/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 60in)} + +<===> units/hue/unknown/output.css +a { + b: yellow; +} + +<===> units/hue/unknown/warning +DEPRECATION WARNING: $hue: Passing a unit other than deg (60in) is deprecated. + +To preserve current behavior: calc($hue / 1in) + +See https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $hue: 60in)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/hue/angle/input.scss +@use "sass:color"; +a {b: color.change(red, $hue: 60rad)} + +<===> units/hue/angle/output.css +a { + b: rgb(0, 179.576224164, 255); +} + +<===> +================================================================================ +<===> units/saturation/percent/input.scss +@use "sass:color"; +a {b: color.change(red, $saturation: 50%)} + +<===> units/saturation/percent/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> +================================================================================ +<===> units/saturation/unitless/input.scss +@use "sass:color"; +a {b: color.change(red, $saturation: 50)} + +<===> units/saturation/unitless/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> units/saturation/unitless/warning +DEPRECATION WARNING: $saturation: Passing a number without unit % (50) is deprecated. + +To preserve current behavior: $saturation * 1% + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $saturation: 50)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/saturation/unknown/input.scss +@use "sass:color"; +a {b: color.change(red, $saturation: 50in)} + +<===> units/saturation/unknown/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> units/saturation/unknown/warning +DEPRECATION WARNING: $saturation: Passing a number without unit % (50in) is deprecated. + +To preserve current behavior: calc($saturation / 1in * 1%) + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $saturation: 50in)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/lightness/percent/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 30%)} + +<===> units/lightness/percent/output.css +a { + b: #990000; +} + +<===> +================================================================================ +<===> units/lightness/unitless/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 30)} + +<===> units/lightness/unitless/output.css +a { + b: #990000; +} + +<===> units/lightness/unitless/warning +DEPRECATION WARNING: $lightness: Passing a number without unit % (30) is deprecated. + +To preserve current behavior: $lightness * 1% + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $lightness: 30)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/lightness/unknown/input.scss +@use "sass:color"; +a {b: color.change(red, $lightness: 30in)} + +<===> units/lightness/unknown/output.css +a { + b: #990000; +} + +<===> units/lightness/unknown/warning +DEPRECATION WARNING: $lightness: Passing a number without unit % (30in) is deprecated. + +To preserve current behavior: calc($lightness / 1in * 1%) + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $lightness: 30in)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.change($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} + +<===> named/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} diff --git a/spec/core_functions/color/change_color/hwb.hrx b/spec/core_functions/color/change/hwb.hrx similarity index 76% rename from spec/core_functions/color/change_color/hwb.hrx rename to spec/core_functions/color/change/hwb.hrx index 8b3968ce4c..500d055c75 100644 --- a/spec/core_functions/color/change_color/hwb.hrx +++ b/spec/core_functions/color/change/hwb.hrx @@ -4,7 +4,7 @@ a {b: color.change(#cc6666, $whiteness: 100%)} <===> whiteness/max/output.css a { - b: #d5d5d5; + b: rgb(212.5, 212.5, 212.5); } <===> @@ -40,6 +40,17 @@ a { b: #cc3333; } +<===> +================================================================================ +<===> whiteness/none/input.scss +@use "sass:color"; +a {b: color.change(hwb(180deg 30% 50%), $whiteness: none)} + +<===> whiteness/none/output.css +a { + b: hwb(180deg none 50%); +} + <===> ================================================================================ <===> blackness/max/input.scss @@ -48,7 +59,7 @@ a {b: color.change(#993333, $blackness: 100%)} <===> blackness/max/output.css a { - b: #2b2b2b; + b: rgb(42.5, 42.5, 42.5); } <===> @@ -84,6 +95,28 @@ a { b: #cc3333; } +<===> +================================================================================ +<===> blackness/none/input.scss +@use "sass:color"; +a {b: color.change(hwb(180deg 30% 50%), $blackness: none)} + +<===> blackness/none/output.css +a { + b: hwb(180deg 30% none); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.change(#993333, $whiteness: 50%, $blackness: -20%)} + +<===> out_of_range/output.css +a { + b: hsl(0, 233.3333333333%, 85%); +} + <===> ================================================================================ <===> all/input.scss diff --git a/spec/core_functions/color/change/lab.hrx b/spec/core_functions/color/change/lab.hrx new file mode 100644 index 0000000000..ebfff685f0 --- /dev/null +++ b/spec/core_functions/color/change/lab.hrx @@ -0,0 +1,162 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $lightness: 30)} + +<===> lightness/unitless/output.css +a { + b: lab(30% 20 -30); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: lab(30% 20 -30); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $lightness: 120%)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in lab, color(xyz 1.7255148283 1.6190494947 2.5266428703) 100%, black); +} + +<===> +================================================================================ +<===> lightness/none/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $lightness: none)} + +<===> lightness/none/output.css +a { + b: lab(none 20 -30); +} + +<===> +================================================================================ +<===> a/unitless/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $a: 50)} + +<===> a/unitless/output.css +a { + b: lab(50% 50 -30); +} + +<===> +================================================================================ +<===> a/percent/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $a: -40%)} + +<===> a/percent/output.css +a { + b: lab(50% -50 -30); +} + +<===> +================================================================================ +<===> a/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $a: 200)} + +<===> a/out_of_range/output.css +a { + b: lab(50% 200 -30); +} + +<===> +================================================================================ +<===> a/none/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $a: none)} + +<===> a/none/output.css +a { + b: lab(50% none -30); +} + +<===> +================================================================================ +<===> b/unitless/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $b: 50)} + +<===> b/unitless/output.css +a { + b: lab(50% 20 50); +} + +<===> +================================================================================ +<===> b/percent/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $b: -40%)} + +<===> b/percent/output.css +a { + b: lab(50% 20 -50); +} + +<===> +================================================================================ +<===> b/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $b: -200)} + +<===> b/out_of_range/output.css +a { + b: lab(50% 20 -200); +} + +<===> +================================================================================ +<===> b/none/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $b: none)} + +<===> b/none/output.css +a { + b: lab(50% 20 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $lightness: 20%, $a: -30, $b: 40)} + +<===> all/output.css +a { + b: lab(20% -30 40); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30 / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: lab(30% 20 -30 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 20 -30), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: lab(30% 20 -30 / 0.9); +} diff --git a/spec/core_functions/color/change/lch.hrx b/spec/core_functions/color/change/lch.hrx new file mode 100644 index 0000000000..7bc57bd218 --- /dev/null +++ b/spec/core_functions/color/change/lch.hrx @@ -0,0 +1,173 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $lightness: 30)} + +<===> lightness/unitless/output.css +a { + b: lch(30% 20 30deg); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: lch(30% 20 30deg); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $lightness: 120%)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in lch, color(xyz 1.6569354424 1.6040925936 1.5400032443) 100%, black); +} + +<===> +================================================================================ +<===> lightness/none/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $lightness: none)} + +<===> lightness/none/output.css +a { + b: lch(none 20 30deg); +} + +<===> +================================================================================ +<===> chroma/unitless/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $chroma: 50)} + +<===> chroma/unitless/output.css +a { + b: lch(50% 50 30deg); +} + +<===> +================================================================================ +<===> chroma/percent/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $chroma: 40%)} + +<===> chroma/percent/output.css +a { + b: lch(50% 60 30deg); +} + +<===> +================================================================================ +<===> chroma/negative/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $chroma: -10)} + +<===> chroma/negative/output.css +a { + b: lch(50% 10 210deg); +} + +<===> +================================================================================ +<===> chroma/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $chroma: 200)} + +<===> chroma/out_of_range/output.css +a { + b: lch(50% 200 30deg); +} + +<===> +================================================================================ +<===> chroma/none/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $chroma: none)} + +<===> chroma/none/output.css +a { + b: lch(50% none 30deg); +} + +<===> +================================================================================ +<===> hue/unitless/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $hue: 50deg)} + +<===> hue/unitless/output.css +a { + b: lch(50% 20 50deg); +} + +<===> +================================================================================ +<===> hue/negative/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $hue: -20deg)} + +<===> hue/negative/output.css +a { + b: lch(50% 20 340deg); +} + +<===> +================================================================================ +<===> hue/above_max/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $hue: 400deg)} + +<===> hue/above_max/output.css +a { + b: lch(50% 20 40deg); +} + +<===> +================================================================================ +<===> hue/none/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $hue: none)} + +<===> hue/none/output.css +a { + b: lch(50% 20 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $lightness: 20%, $chroma: 30, $hue: 40deg)} + +<===> all/output.css +a { + b: lch(20% 30 40deg); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: lch(30% 20 30deg / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(lch(50% 20 30deg), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: lch(30% 20 30deg / 0.9); +} diff --git a/spec/core_functions/color/change/no_space.hrx b/spec/core_functions/color/change/no_space.hrx new file mode 100644 index 0000000000..52537c87d8 --- /dev/null +++ b/spec/core_functions/color/change/no_space.hrx @@ -0,0 +1,142 @@ +<===> positional/input.scss +@use "sass:color"; +a {b: color.change(red)} + +<===> positional/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.change($color: red)} + +<===> named/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> non_legacy/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 50 50))} + +<===> non_legacy/output.css +a { + b: lab(50% 50 50); +} + +<===> +================================================================================ +<===> alpha/max/input.scss +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 1)} + +<===> alpha/max/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> alpha/min/input.scss +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 0)} + +<===> alpha/min/output.css +a { + b: rgba(255, 0, 0, 0); +} + +<===> +================================================================================ +<===> alpha/high/input.scss +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 0.72)} + +<===> alpha/high/output.css +a { + b: rgba(255, 0, 0, 0.72); +} + +<===> +================================================================================ +<===> alpha/low/input.scss +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 0.36)} + +<===> alpha/low/output.css +a { + b: rgba(255, 0, 0, 0.36); +} + +<===> +================================================================================ +<===> alpha/non_legacy/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 50 50), $alpha: 0.36)} + +<===> alpha/non_legacy/output.css +a { + b: lab(50% 50 50 / 0.36); +} + +<===> +================================================================================ +<===> alpha/units/unitless/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: 0.5)} + +<===> alpha/units/unitless/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> alpha/units/percent/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: 50%)} + +<===> alpha/units/percent/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> alpha/units/unknown/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: 0.5px)} + +<===> alpha/units/unknown/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> alpha/units/unknown/warning +DEPRECATION WARNING: $alpha: Passing a unit other than % (0.5px) is deprecated. + +To preserve current behavior: calc($alpha / 1px) + +See https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $alpha: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/none/input.scss +@use "sass:color"; +a {b: color.change(red, $alpha: none)} + +<===> alpha/none/output.css +a { + b: rgb(255 0 0 / none); +} diff --git a/spec/core_functions/color/change/oklab.hrx b/spec/core_functions/color/change/oklab.hrx new file mode 100644 index 0000000000..e6f12e30cf --- /dev/null +++ b/spec/core_functions/color/change/oklab.hrx @@ -0,0 +1,162 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 0.3)} + +<===> lightness/unitless/output.css +a { + b: oklab(30% 0.2 -0.3); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: oklab(30% 0.2 -0.3); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 1.2)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in oklab, color(xyz 2.3267923962 1.5626810194 5.2743259015) 100%, black); +} + +<===> +================================================================================ +<===> lightness/none/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: none)} + +<===> lightness/none/output.css +a { + b: oklab(none 0.2 -0.3); +} + +<===> +================================================================================ +<===> a/unitless/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $a: 0.1)} + +<===> a/unitless/output.css +a { + b: oklab(50% 0.1 -0.3); +} + +<===> +================================================================================ +<===> a/percent/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $a: -40%)} + +<===> a/percent/output.css +a { + b: oklab(50% -0.16 -0.3); +} + +<===> +================================================================================ +<===> a/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $a: 1)} + +<===> a/out_of_range/output.css +a { + b: oklab(50% 1 -0.3); +} + +<===> +================================================================================ +<===> a/none/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $a: none)} + +<===> a/none/output.css +a { + b: oklab(50% none -0.3); +} + +<===> +================================================================================ +<===> b/unitless/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $b: 0.4)} + +<===> b/unitless/output.css +a { + b: oklab(50% 0.2 0.4); +} + +<===> +================================================================================ +<===> b/percent/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $b: -40%)} + +<===> b/percent/output.css +a { + b: oklab(50% 0.2 -0.16); +} + +<===> +================================================================================ +<===> b/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $b: -1)} + +<===> b/out_of_range/output.css +a { + b: oklab(50% 0.2 -1); +} + +<===> +================================================================================ +<===> b/none/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $b: none)} + +<===> b/none/output.css +a { + b: oklab(50% 0.2 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 20%, $a: -0.3, $b: 0.4)} + +<===> all/output.css +a { + b: oklab(20% -0.3 0.4); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3 / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: oklab(30% 0.2 -0.3 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: oklab(30% 0.2 -0.3 / 0.9); +} diff --git a/spec/core_functions/color/change/oklch.hrx b/spec/core_functions/color/change/oklch.hrx new file mode 100644 index 0000000000..9137a93b71 --- /dev/null +++ b/spec/core_functions/color/change/oklch.hrx @@ -0,0 +1,173 @@ +<===> lightness/unitless/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 0.3)} + +<===> lightness/unitless/output.css +a { + b: oklch(30% 0.2 30deg); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: oklch(30% 0.2 30deg); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 120%)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in oklch, color(xyz 2.0602078346 1.6344742217 1.0169251403) 100%, black); +} + +<===> +================================================================================ +<===> lightness/none/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: none)} + +<===> lightness/none/output.css +a { + b: oklch(none 0.2 30deg); +} + +<===> +================================================================================ +<===> chroma/unitless/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: 0.1)} + +<===> chroma/unitless/output.css +a { + b: oklch(50% 0.1 30deg); +} + +<===> +================================================================================ +<===> chroma/percent/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: 40%)} + +<===> chroma/percent/output.css +a { + b: oklch(50% 0.16 30deg); +} + +<===> +================================================================================ +<===> chroma/negative/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: -0.1)} + +<===> chroma/negative/output.css +a { + b: oklch(50% 0.1 210deg); +} + +<===> +================================================================================ +<===> chroma/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: 1)} + +<===> chroma/out_of_range/output.css +a { + b: oklch(50% 1 30deg); +} + +<===> +================================================================================ +<===> chroma/none/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: none)} + +<===> chroma/none/output.css +a { + b: oklch(50% none 30deg); +} + +<===> +================================================================================ +<===> hue/unitless/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $hue: 50deg)} + +<===> hue/unitless/output.css +a { + b: oklch(50% 0.2 50deg); +} + +<===> +================================================================================ +<===> hue/negative/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $hue: -20deg)} + +<===> hue/negative/output.css +a { + b: oklch(50% 0.2 340deg); +} + +<===> +================================================================================ +<===> hue/above_max/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $hue: 400deg)} + +<===> hue/above_max/output.css +a { + b: oklch(50% 0.2 40deg); +} + +<===> +================================================================================ +<===> hue/none/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $hue: none)} + +<===> hue/none/output.css +a { + b: oklch(50% 0.2 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 20%, $chroma: 0.1, $hue: 40deg)} + +<===> all/output.css +a { + b: oklch(20% 0.1 40deg); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: oklch(30% 0.2 30deg / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: oklch(30% 0.2 30deg / 0.9); +} diff --git a/spec/core_functions/color/change/prophoto_rgb.hrx b/spec/core_functions/color/change/prophoto_rgb.hrx new file mode 100644 index 0000000000..fe96dcfccb --- /dev/null +++ b/spec/core_functions/color/change/prophoto_rgb.hrx @@ -0,0 +1,162 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(prophoto-rgb 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/none/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: none)} + +<===> red/none/output.css +a { + b: color(prophoto-rgb none 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(prophoto-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(prophoto-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(prophoto-rgb 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> green/none/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: none)} + +<===> green/none/output.css +a { + b: color(prophoto-rgb 0.2 none 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(prophoto-rgb 0.2 0.5 100); +} + +<===> +================================================================================ +<===> blue/none/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: none)} + +<===> blue/none/output.css +a { + b: color(prophoto-rgb 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(prophoto-rgb 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/rec2020.hrx b/spec/core_functions/color/change/rec2020.hrx new file mode 100644 index 0000000000..e3c2070ed9 --- /dev/null +++ b/spec/core_functions/color/change/rec2020.hrx @@ -0,0 +1,162 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(rec2020 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(rec2020 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(rec2020 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/none/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: none)} + +<===> red/none/output.css +a { + b: color(rec2020 none 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(rec2020 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(rec2020 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(rec2020 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> green/none/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: none)} + +<===> green/none/output.css +a { + b: color(rec2020 0.2 none 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(rec2020 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(rec2020 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(rec2020 0.2 0.5 100); +} + +<===> +================================================================================ +<===> blue/none/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: none)} + +<===> blue/none/output.css +a { + b: color(rec2020 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(rec2020 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(rec2020 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(rec2020 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change_color/rgb.hrx b/spec/core_functions/color/change/rgb.hrx similarity index 70% rename from spec/core_functions/color/change_color/rgb.hrx rename to spec/core_functions/color/change/rgb.hrx index 6316e00d43..cfff566692 100644 --- a/spec/core_functions/color/change_color/rgb.hrx +++ b/spec/core_functions/color/change/rgb.hrx @@ -40,6 +40,28 @@ a { b: #c80000; } +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(black, $red: 500)} + +<===> red/out_of_range/output.css +a { + b: hsl(0, 5000%, 98.0392156863%); +} + +<===> +================================================================================ +<===> red/none/input.scss +@use "sass:color"; +a {b: color.change(black, $red: none)} + +<===> red/none/output.css +a { + b: rgb(none 0 0); +} + <===> ================================================================================ <===> green/max/input.scss @@ -84,6 +106,28 @@ a { b: #00c800; } +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(black, $green: -50)} + +<===> green/out_of_range/output.css +a { + b: hsl(120, 100%, -9.8039215686%); +} + +<===> +================================================================================ +<===> green/none/input.scss +@use "sass:color"; +a {b: color.change(black, $green: none)} + +<===> green/none/output.css +a { + b: rgb(0 none 0); +} + <===> ================================================================================ <===> blue/max/input.scss @@ -128,6 +172,28 @@ a { b: #0000c8; } +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(black, $blue: 256)} + +<===> blue/out_of_range/output.css +a { + b: hsl(240, 100.7874015748%, 50.1960784314%); +} + +<===> +================================================================================ +<===> blue/none/input.scss +@use "sass:color"; +a {b: color.change(black, $blue: none)} + +<===> blue/none/output.css +a { + b: rgb(0 0 none); +} + <===> ================================================================================ <===> all/input.scss diff --git a/spec/core_functions/color/change/space.hrx b/spec/core_functions/color/change/space.hrx new file mode 100644 index 0000000000..986f71f6db --- /dev/null +++ b/spec/core_functions/color/change/space.hrx @@ -0,0 +1,228 @@ +<===> identical/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0.2 0deg), $space: lab)} + +<===> identical/output.css +a { + b: oklch(50% 0.2 0deg); +} + +<===> +================================================================================ +<===> legacy/to_legacy/input.scss +@use "sass:color"; +a {b: color.change(pink, $saturation: 5%, $space: hsl)} + +<===> legacy/to_legacy/output.css +a { + b: rgb(225.075, 221.925, 222.475); +} + +<===> +================================================================================ +<===> legacy/to_modern/input.scss +@use "sass:color"; +a {b: color.change(pink, $chroma: 0.01, $space: oklch)} + +<===> legacy/to_modern/output.css +a { + b: rgb(217.7587670223, 208.8497864408, 210.1600909257); +} + +<===> +================================================================================ +<===> modern/to_legacy/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 10 -20), $saturation: 5%, $space: hsl)} + +<===> modern/to_legacy/output.css +a { + b: lab(53.9442763509% 2.9406893179 -6.1872703789); +} + +<===> +================================================================================ +<===> modern/to_modern/input.scss +@use "sass:color"; +a {b: color.change(lab(50% 10 -20), $chroma: 0.01, $space: oklch)} + +<===> modern/to_modern/output.css +a { + b: lab(50.5994457353% 1.499908117 -3.4111247636); +} + +<===> +================================================================================ +<===> powerless/legacy/input.scss +@use "sass:color"; +a {b: color.change(hsl(0deg 0% 50%), $space: lab)} + +<===> powerless/legacy/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> +================================================================================ +<===> powerless/modern/input.scss +@use "sass:color"; +a {b: color.change(oklch(50% 0 0deg), $space: lab)} + +<===> powerless/modern/output.css +a { + b: oklch(50% 0 none); +} + +<===> +================================================================================ +<===> missing/arg/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.change(pink, $red: none)} + +<===> missing/arg/legacy/same/implicit/output.css +a { + b: rgb(none 192 203); +} + +<===> +================================================================================ +<===> missing/arg/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.change(pink, $red: none, $space: rgb)} + +<===> missing/arg/legacy/same/explicit/output.css +a { + b: rgb(none 192 203); +} + +<===> +================================================================================ +<===> missing/arg/legacy/analogous/legacy/input.scss +@use "sass:color"; +a {b: color.change(hsl(100deg 50% 50%), $hue: none, $space: hwb)} + +<===> missing/arg/legacy/analogous/legacy/output.css +a { + b: hsl(0, 50%, 50%); +} + +<===> +================================================================================ +<===> missing/arg/legacy/analogous/modern/input.scss +@use "sass:color"; +a {b: color.change(pink, $red: none, $space: display-p3)} + +<===> missing/arg/legacy/analogous/modern/output.css +a { + b: rgb(0, 198.1453699836, 205.7002828396); +} + +<===> +================================================================================ +<===> missing/arg/modern/same/implicit/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.1 0.2 0.3), $red: none)} + +<===> missing/arg/modern/same/implicit/output.css +a { + b: color(srgb none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/arg/modern/same/explicit/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.1 0.2 0.3), $red: none, $space: srgb)} + +<===> missing/arg/modern/same/explicit/output.css +a { + b: color(srgb none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/arg/modern/analogous/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.1 0.2 0.3), $red: none, $space: display-p3)} + +<===> missing/arg/modern/analogous/output.css +a { + b: color(srgb none 0.2018961688 0.3005594241); +} + +<===> +================================================================================ +<===> missing/color/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.change(rgb(none none none))} + +<===> missing/color/legacy/same/implicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> missing/color/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.change(rgb(none none none), $space: rgb)} + +<===> missing/color/legacy/same/explicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> missing/color/legacy/analogous/legacy/input.scss +@use "sass:color"; +a {b: color.change(hsl(none 50% 50%), $space: hwb)} + +<===> missing/color/legacy/analogous/legacy/output.css +a { + b: hsl(0, 50%, 50%); +} + +<===> +================================================================================ +<===> missing/color/legacy/analogous/modern/input.scss +@use "sass:color"; +a {b: color.change(rgb(none none none), $space: display-p3)} + +<===> missing/color/legacy/analogous/modern/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> missing/color/modern/same/implicit/input.scss +@use "sass:color"; +a {b: color.change(color(srgb none none none))} + +<===> missing/color/modern/same/implicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> missing/color/modern/same/explicit/input.scss +@use "sass:color"; +a {b: color.change(color(srgb none none none), $space: srgb)} + +<===> missing/color/modern/same/explicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> missing/color/modern/analogous/input.scss +@use "sass:color"; +a {b: color.change(color(srgb none none none), $space: display-p3)} + +<===> missing/color/modern/analogous/output.css +a { + b: color(srgb none none none); +} diff --git a/spec/core_functions/color/change/srgb.hrx b/spec/core_functions/color/change/srgb.hrx new file mode 100644 index 0000000000..955eab264d --- /dev/null +++ b/spec/core_functions/color/change/srgb.hrx @@ -0,0 +1,162 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(srgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(srgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(srgb 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/none/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: none)} + +<===> red/none/output.css +a { + b: color(srgb none 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(srgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(srgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(srgb 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> green/none/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: none)} + +<===> green/none/output.css +a { + b: color(srgb 0.2 none 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(srgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(srgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(srgb 0.2 0.5 100); +} + +<===> +================================================================================ +<===> blue/none/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: none)} + +<===> blue/none/output.css +a { + b: color(srgb 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(srgb 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(srgb 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(srgb 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/srgb_linear.hrx b/spec/core_functions/color/change/srgb_linear.hrx new file mode 100644 index 0000000000..945480f624 --- /dev/null +++ b/spec/core_functions/color/change/srgb_linear.hrx @@ -0,0 +1,162 @@ +<===> red/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(srgb-linear 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/none/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: none)} + +<===> red/none/output.css +a { + b: color(srgb-linear none 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(srgb-linear 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(srgb-linear 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(srgb-linear 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> green/none/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: none)} + +<===> green/none/output.css +a { + b: color(srgb-linear 0.2 none 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(srgb-linear 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(srgb-linear 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(srgb-linear 0.2 0.5 100); +} + +<===> +================================================================================ +<===> blue/none/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: none)} + +<===> blue/none/output.css +a { + b: color(srgb-linear 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(srgb-linear 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/xyz.hrx b/spec/core_functions/color/change/xyz.hrx new file mode 100644 index 0000000000..7316ae29f7 --- /dev/null +++ b/spec/core_functions/color/change/xyz.hrx @@ -0,0 +1,162 @@ +<===> x/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5)} + +<===> x/unitless/output.css +a { + b: color(xyz 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/percent/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 50%)} + +<===> x/percent/output.css +a { + b: color(xyz 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 1.2)} + +<===> x/out_of_range/output.css +a { + b: color(xyz 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> x/none/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: none)} + +<===> x/none/output.css +a { + b: color(xyz none 0.5 0.7); +} + +<===> +================================================================================ +<===> y/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 0.4)} + +<===> y/unitless/output.css +a { + b: color(xyz 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/percent/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 40%)} + +<===> y/percent/output.css +a { + b: color(xyz 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: -0.2)} + +<===> y/out_of_range/output.css +a { + b: color(xyz 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> y/none/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: none)} + +<===> y/none/output.css +a { + b: color(xyz 0.2 none 0.7); +} + +<===> +================================================================================ +<===> z/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 0.5)} + +<===> z/unitless/output.css +a { + b: color(xyz 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/percent/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 50%)} + +<===> z/percent/output.css +a { + b: color(xyz 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 100)} + +<===> z/out_of_range/output.css +a { + b: color(xyz 0.2 0.5 100); +} + +<===> +================================================================================ +<===> z/none/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: none)} + +<===> z/none/output.css +a { + b: color(xyz 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.7, $y: 0.4, $z: 0.2)} + +<===> all/output.css +a { + b: color(xyz 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7 / 0.9), $x: 0.5)} + +<===> alpha_input/output.css +a { + b: color(xyz 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(xyz 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/xyz_d50.hrx b/spec/core_functions/color/change/xyz_d50.hrx new file mode 100644 index 0000000000..eeae1d6eb8 --- /dev/null +++ b/spec/core_functions/color/change/xyz_d50.hrx @@ -0,0 +1,162 @@ +<===> x/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5)} + +<===> x/unitless/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/percent/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 50%)} + +<===> x/percent/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 1.2)} + +<===> x/out_of_range/output.css +a { + b: color(xyz-d50 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> x/none/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: none)} + +<===> x/none/output.css +a { + b: color(xyz-d50 none 0.5 0.7); +} + +<===> +================================================================================ +<===> y/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 0.4)} + +<===> y/unitless/output.css +a { + b: color(xyz-d50 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/percent/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 40%)} + +<===> y/percent/output.css +a { + b: color(xyz-d50 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: -0.2)} + +<===> y/out_of_range/output.css +a { + b: color(xyz-d50 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> y/none/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: none)} + +<===> y/none/output.css +a { + b: color(xyz-d50 0.2 none 0.7); +} + +<===> +================================================================================ +<===> z/unitless/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 0.5)} + +<===> z/unitless/output.css +a { + b: color(xyz-d50 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/percent/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 50%)} + +<===> z/percent/output.css +a { + b: color(xyz-d50 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/out_of_range/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 100)} + +<===> z/out_of_range/output.css +a { + b: color(xyz-d50 0.2 0.5 100); +} + +<===> +================================================================================ +<===> z/none/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: none)} + +<===> z/none/output.css +a { + b: color(xyz-d50 0.2 0.5 none); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.7, $y: 0.4, $z: 0.2)} + +<===> all/output.css +a { + b: color(xyz-d50 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7 / 0.9), $x: 0.5)} + +<===> alpha_input/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change_color/error/bounds.hrx b/spec/core_functions/color/change_color/error/bounds.hrx deleted file mode 100644 index b95135e170..0000000000 --- a/spec/core_functions/color/change_color/error/bounds.hrx +++ /dev/null @@ -1,353 +0,0 @@ -<===> red/too_low/input.scss -@use "sass:color"; -a {b: color.change(red, $red: -1)} - -<===> red/too_low/error -Error: $red: Expected -1 to be within 0 and 255. - , -2 | a {b: color.change(red, $red: -1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> red/too_high/input.scss -@use "sass:color"; -a {b: color.change(red, $red: 256)} - -<===> red/too_high/error -Error: $red: Expected 256 to be within 0 and 255. - , -2 | a {b: color.change(red, $red: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> red/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.change(red, $red: 300px)} - -<===> red/unit/error -Error: $red: Expected 300px to be within 0 and 255. - , -4 | a {b: color.change(red, $red: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> green/too_low/input.scss -@use "sass:color"; -a {b: color.change(green, $green: -1)} - -<===> green/too_low/error -Error: $green: Expected -1 to be within 0 and 255. - , -2 | a {b: color.change(green, $green: -1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> green/too_high/input.scss -@use "sass:color"; -a {b: color.change(green, $green: 256)} - -<===> green/too_high/error -Error: $green: Expected 256 to be within 0 and 255. - , -2 | a {b: color.change(green, $green: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> green/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.change(green, $green: 300px)} - -<===> green/unit/error -Error: $green: Expected 300px to be within 0 and 255. - , -4 | a {b: color.change(green, $green: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_low/input.scss -@use "sass:color"; -a {b: color.change(blue, $blue: -1)} - -<===> blue/too_low/error -Error: $blue: Expected -1 to be within 0 and 255. - , -2 | a {b: color.change(blue, $blue: -1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_high/input.scss -@use "sass:color"; -a {b: color.change(blue, $blue: 256)} - -<===> blue/too_high/error -Error: $blue: Expected 256 to be within 0 and 255. - , -2 | a {b: color.change(blue, $blue: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blue/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.change(blue, $blue: 300px)} - -<===> blue/unit/error -Error: $blue: Expected 300px to be within 0 and 255. - , -4 | a {b: color.change(blue, $blue: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_low/input.scss -@use "sass:color"; -a {b: color.change(red, $saturation: -0.001%)} - -<===> saturation/too_low/error -Error: $saturation: Expected -0.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $saturation: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_high/input.scss -@use "sass:color"; -a {b: color.change(red, $saturation: 100.001%)} - -<===> saturation/too_high/error -Error: $saturation: Expected 100.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $saturation: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> saturation/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.change(red, $saturation: 200px)} - -<===> saturation/unit/error -DEPRECATION WARNING: $saturation: Passing a number without unit % (200px) is deprecated. - -To preserve current behavior: calc($saturation / 1px * 1%) - -More info: https://sass-lang.com/d/function-units - - , -4 | a {b: color.change(red, $saturation: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -Error: $saturation: Expected 200px to be within 0% and 100%. - , -4 | a {b: color.change(red, $saturation: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_low/input.scss -@use "sass:color"; -a {b: color.change(red, $lightness: -0.001%)} - -<===> lightness/too_low/error -Error: $lightness: Expected -0.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $lightness: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_high/input.scss -@use "sass:color"; -a {b: color.change(red, $lightness: 100.001%)} - -<===> lightness/too_high/error -Error: $lightness: Expected 100.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $lightness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.change(red, $lightness: 200px)} - -<===> lightness/unit/error -DEPRECATION WARNING: $lightness: Passing a number without unit % (200px) is deprecated. - -To preserve current behavior: calc($lightness / 1px * 1%) - -More info: https://sass-lang.com/d/function-units - - , -4 | a {b: color.change(red, $lightness: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -Error: $lightness: Expected 200px to be within 0% and 100%. - , -4 | a {b: color.change(red, $lightness: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_low/input.scss -@use "sass:color"; -a {b: color.change(red, $alpha: -0.001)} - -<===> alpha/too_low/error -Error: $alpha: Expected -0.001 to be within 0 and 1. - , -2 | a {b: color.change(red, $alpha: -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_high/input.scss -@use "sass:color"; -a {b: color.change(red, $alpha: 1.001)} - -<===> alpha/too_high/error -Error: $alpha: Expected 1.001 to be within 0 and 1. - , -2 | a {b: color.change(red, $alpha: 1.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/unit/input.scss -@use "sass:color"; -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: color.change(red, $alpha: 50%)} - -<===> alpha/unit/error -DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. - -To preserve current behavior: calc($alpha / 1%) - -More info: https://sass-lang.com/d/function-units - - , -4 | a {b: color.change(red, $alpha: 50%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -Error: $alpha: Expected 50% to be within 0 and 1. - , -4 | a {b: color.change(red, $alpha: 50%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 4:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_low/input.scss -@use "sass:color"; -a {b: color.change(red, $blackness: -0.001%)} - -<===> blackness/too_low/error -Error: $blackness: Expected -0.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $blackness: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_high/input.scss -@use "sass:color"; -a {b: color.change(red, $blackness: 100.001%)} - -<===> blackness/too_high/error -Error: $blackness: Expected 100.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $blackness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_low/input.scss -@use "sass:color"; -a {b: color.change(red, $whiteness: -0.001%)} - -<===> whiteness/too_low/error -Error: $whiteness: Expected -0.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $whiteness: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_high/input.scss -@use "sass:color"; -a {b: color.change(red, $whiteness: 100.001%)} - -<===> whiteness/too_high/error -Error: $whiteness: Expected 100.001% to be within 0% and 100%. - , -2 | a {b: color.change(red, $whiteness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/no_rgb_hsl.hrx b/spec/core_functions/color/change_color/no_rgb_hsl.hrx deleted file mode 100644 index 5daadafb57..0000000000 --- a/spec/core_functions/color/change_color/no_rgb_hsl.hrx +++ /dev/null @@ -1,63 +0,0 @@ -<===> positional/input.scss -@use "sass:color"; -a {b: color.change(red)} - -<===> positional/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> named/input.scss -@use "sass:color"; -a {b: color.change($color: red)} - -<===> named/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> alpha/max/input.scss -@use "sass:color"; -a {b: color.change(rgba(red, 0.5), $alpha: 1)} - -<===> alpha/max/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> alpha/min/input.scss -@use "sass:color"; -a {b: color.change(rgba(red, 0.5), $alpha: 0)} - -<===> alpha/min/output.css -a { - b: rgba(255, 0, 0, 0); -} - -<===> -================================================================================ -<===> alpha/high/input.scss -@use "sass:color"; -a {b: color.change(rgba(red, 0.5), $alpha: 0.72)} - -<===> alpha/high/output.css -a { - b: rgba(255, 0, 0, 0.72); -} - -<===> -================================================================================ -<===> alpha/low/input.scss -@use "sass:color"; -a {b: color.change(rgba(red, 0.5), $alpha: 0.36)} - -<===> alpha/low/output.css -a { - b: rgba(255, 0, 0, 0.36); -} diff --git a/spec/core_functions/color/change_color/units.hrx b/spec/core_functions/color/change_color/units.hrx deleted file mode 100644 index 962e224d7a..0000000000 --- a/spec/core_functions/color/change_color/units.hrx +++ /dev/null @@ -1,231 +0,0 @@ -<===> hue/deg/input.scss -@use "sass:color"; -a {b: color.change(red, $hue: 60deg)} - -<===> hue/deg/output.css -a { - b: yellow; -} - -<===> -================================================================================ -<===> hue/unitless/input.scss -@use "sass:color"; -a {b: color.change(red, $hue: 60)} - -<===> hue/unitless/output.css -a { - b: yellow; -} - -<===> -================================================================================ -<===> hue/unknown/input.scss -@use "sass:color"; -a {b: color.change(red, $hue: 60in)} - -<===> hue/unknown/output.css -a { - b: yellow; -} - -<===> hue/unknown/warning -DEPRECATION WARNING: $hue: Passing a unit other than deg (60in) is deprecated. - -To preserve current behavior: calc($hue / 1in) - -See https://sass-lang.com/d/function-units - - , -2 | a {b: color.change(red, $hue: 60in)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> hue/angle/input.scss -@use "sass:color"; -a {b: color.change(red, $hue: 60rad)} - -<===> hue/angle/output.css -a { - b: #00b4ff; -} - -<===> -================================================================================ -<===> saturation/percent/input.scss -@use "sass:color"; -a {b: color.change(red, $saturation: 50%)} - -<===> saturation/percent/output.css -a { - b: #bf4040; -} - -<===> -================================================================================ -<===> saturation/unitless/input.scss -@use "sass:color"; -a {b: color.change(red, $saturation: 50)} - -<===> saturation/unitless/output.css -a { - b: #bf4040; -} - -<===> saturation/unitless/warning -DEPRECATION WARNING: $saturation: Passing a number without unit % (50) is deprecated. - -To preserve current behavior: $saturation * 1% - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.change(red, $saturation: 50)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> saturation/unknown/input.scss -@use "sass:color"; -a {b: color.change(red, $saturation: 50in)} - -<===> saturation/unknown/output.css -a { - b: #bf4040; -} - -<===> saturation/unknown/warning -DEPRECATION WARNING: $saturation: Passing a number without unit % (50in) is deprecated. - -To preserve current behavior: calc($saturation / 1in * 1%) - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.change(red, $saturation: 50in)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/percent/input.scss -@use "sass:color"; -a {b: color.change(red, $lightness: 30%)} - -<===> lightness/percent/output.css -a { - b: #990000; -} - -<===> -================================================================================ -<===> lightness/unitless/input.scss -@use "sass:color"; -a {b: color.change(red, $lightness: 30)} - -<===> lightness/unitless/output.css -a { - b: #990000; -} - -<===> lightness/unitless/warning -DEPRECATION WARNING: $lightness: Passing a number without unit % (30) is deprecated. - -To preserve current behavior: $lightness * 1% - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.change(red, $lightness: 30)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/unknown/input.scss -@use "sass:color"; -a {b: color.change(red, $lightness: 30in)} - -<===> lightness/unknown/output.css -a { - b: #990000; -} - -<===> lightness/unknown/warning -DEPRECATION WARNING: $lightness: Passing a number without unit % (30in) is deprecated. - -To preserve current behavior: calc($lightness / 1in * 1%) - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.change(red, $lightness: 30in)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/unitless/input.scss -@use "sass:color"; -a {b: color.change(red, $alpha: 0.5)} - -<===> alpha/unitless/output.css -a { - b: rgba(255, 0, 0, 0.5); -} - -<===> -================================================================================ -<===> alpha/percent/input.scss -@use "sass:color"; -a {b: color.adjust(red, $alpha: 0.5%)} - -<===> alpha/percent/output.css -a { - b: red; -} - -<===> alpha/percent/warning -DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. - -To preserve current behavior: calc($alpha / 1%) - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.adjust(red, $alpha: 0.5%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/unknown/input.scss -@use "sass:color"; -a {b: color.adjust(red, $alpha: 0.5px)} - -<===> alpha/unknown/output.css -a { - b: red; -} - -<===> alpha/unknown/warning -DEPRECATION WARNING: $alpha: Passing a number with unit px is deprecated. - -To preserve current behavior: calc($alpha / 1px) - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.adjust(red, $alpha: 0.5px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/channel/a98-rgb.hrx b/spec/core_functions/color/channel/a98-rgb.hrx new file mode 100644 index 0000000000..54d9ca4f3c --- /dev/null +++ b/spec/core_functions/color/channel/a98-rgb.hrx @@ -0,0 +1,63 @@ +<===> local/red/input.scss +@use "sass:color"; +a {b: color.channel(color(a98-rgb 0.2 0.5 0.8), "red")} + +<===> local/red/output.css +a { + b: 0.2; +} + +<===> +================================================================================ +<===> local/green/input.scss +@use "sass:color"; +a {b: color.channel(color(a98-rgb 0.2 0.5 0.8), "green")} + +<===> local/green/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/blue/input.scss +@use "sass:color"; +a {b: color.channel(color(a98-rgb 0.2 0.5 0.8), "blue")} + +<===> local/blue/output.css +a { + b: 0.8; +} + +<===> +================================================================================ +<===> foreign/red/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", $space: a98-rgb)} + +<===> foreign/red/output.css +a { + b: 0.9363244101; +} + +<===> +================================================================================ +<===> foreign/green/input.scss +@use "sass:color"; +a {b: color.channel(pink, "green", $space: a98-rgb)} + +<===> foreign/green/output.css +a { + b: 0.7473920857; +} + +<===> +================================================================================ +<===> foreign/blue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blue", $space: a98-rgb)} + +<===> foreign/blue/output.css +a { + b: 0.7893042668; +} diff --git a/spec/core_functions/color/channel/display-p3.hrx b/spec/core_functions/color/channel/display-p3.hrx new file mode 100644 index 0000000000..06e4af4a59 --- /dev/null +++ b/spec/core_functions/color/channel/display-p3.hrx @@ -0,0 +1,63 @@ +<===> local/red/input.scss +@use "sass:color"; +a {b: color.channel(color(display-p3 0.2 0.5 0.8), "red")} + +<===> local/red/output.css +a { + b: 0.2; +} + +<===> +================================================================================ +<===> local/green/input.scss +@use "sass:color"; +a {b: color.channel(color(display-p3 0.2 0.5 0.8), "green")} + +<===> local/green/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/blue/input.scss +@use "sass:color"; +a {b: color.channel(color(display-p3 0.2 0.5 0.8), "blue")} + +<===> local/blue/output.css +a { + b: 0.8; +} + +<===> +================================================================================ +<===> foreign/red/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", $space: display-p3)} + +<===> foreign/red/output.css +a { + b: 0.9621487118; +} + +<===> +================================================================================ +<===> foreign/green/input.scss +@use "sass:color"; +a {b: color.channel(pink, "green", $space: display-p3)} + +<===> foreign/green/output.css +a { + b: 0.7628803605; +} + +<===> +================================================================================ +<===> foreign/blue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blue", $space: display-p3)} + +<===> foreign/blue/output.css +a { + b: 0.7971503319; +} diff --git a/spec/core_functions/color/channel/error.hrx b/spec/core_functions/color/channel/error.hrx new file mode 100644 index 0000000000..081e614000 --- /dev/null +++ b/spec/core_functions/color/channel/error.hrx @@ -0,0 +1,159 @@ +<===> too_few_args/input.scss +@use "sass:color"; +a {b: color.channel(pink)} + +<===> too_few_args/error +Error: Missing argument $channel. + ,--> input.scss +2 | a {b: color.channel(pink)} + | ^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function channel($color, $channel, $space: null) { + | ======================================= declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", rgb, "red")} + +<===> too_many_args/error +Error: Only 3 arguments allowed, but 4 were passed. + ,--> input.scss +2 | a {b: color.channel(pink, "red", rgb, "red")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function channel($color, $channel, $space: null) { + | ======================================= declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/color/input.scss +@use "sass:color"; +a {b: color.channel("pink", "red")} + +<===> type/color/error +Error: $color: "pink" is not a color. + , +2 | a {b: color.channel("pink", "red")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/channel/input.scss +@use "sass:color"; +a {b: color.channel(pink, red)} + +<===> type/channel/error +Error: $channel: red is not a string. + , +2 | a {b: color.channel(pink, red)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/space/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", red)} + +<===> type/space/error +Error: $space: red is not a string. + , +2 | a {b: color.channel(pink, "red", red)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/unquoted/input.scss +@use "sass:color"; +a {b: color.channel(hsl(50deg 50% 50%), hue)} + +<===> channel/unquoted/error +Error: $channel: Expected hue to be a quoted string. + , +2 | a {b: color.channel(hsl(50deg 50% 50%), hue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/wrong_space/input.scss +@use "sass:color"; +a {b: color.channel(red, "hue")} + +<===> channel/wrong_space/error +Error: $channel: Color red has no channel named hue. + , +2 | a {b: color.channel(red, "hue")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/wrong_case/input.scss +@use "sass:color"; +a {b: color.channel(red, "RED")} + +<===> channel/wrong_case/error +Error: $channel: Color red has no channel named RED. + , +2 | a {b: color.channel(red, "RED")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/unknown/input.scss +@use "sass:color"; +a {b: color.channel(red, "foo")} + +<===> channel/unknown/error +Error: $channel: Color red has no channel named foo. + , +2 | a {b: color.channel(red, "foo")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/quoted/input.scss +@use "sass:color"; +a {b: color.channel(red, "hue", $space: "hsl")} + +<===> space/quoted/error +Error: $space: Expected "hsl" to be an unquoted string. + , +2 | a {b: color.channel(red, "hue", $space: "hsl")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/unknown/input.scss +@use "sass:color"; +a {b: color.channel(red, "hue", $space: "foo")} + +<===> space/unknown/error +Error: $space: Expected "foo" to be an unquoted string. + , +2 | a {b: color.channel(red, "hue", $space: "foo")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/channel/hsl.hrx b/spec/core_functions/color/channel/hsl.hrx new file mode 100644 index 0000000000..38d42c5a3d --- /dev/null +++ b/spec/core_functions/color/channel/hsl.hrx @@ -0,0 +1,74 @@ +<===> local/hue/input.scss +@use "sass:color"; +a {b: color.channel(hsl(10 40% 60%), "hue")} + +<===> local/hue/output.css +a { + b: 10deg; +} + +<===> +================================================================================ +<===> local/saturation/input.scss +@use "sass:color"; +a {b: color.channel(hsl(10deg 40% 60%), "saturation")} + +<===> local/saturation/output.css +a { + b: 40%; +} + +<===> +================================================================================ +<===> local/lightness/input.scss +@use "sass:color"; +a {b: color.channel(hsl(10deg 40% 60%), "lightness")} + +<===> local/lightness/output.css +a { + b: 60%; +} + +<===> +================================================================================ +<===> local/normalized/hue/input.scss +@use "sass:color"; +a {b: color.channel(hsl(540 40% 60%), "hue")} + +<===> local/normalized/hue/output.css +a { + b: 180deg; +} + +<===> +================================================================================ +<===> foreign/hue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "hue", $space: hsl)} + +<===> foreign/hue/output.css +a { + b: 349.5238095238deg; +} + +<===> +================================================================================ +<===> foreign/saturation/input.scss +@use "sass:color"; +a {b: color.channel(pink, "saturation", $space: hsl)} + +<===> foreign/saturation/output.css +a { + b: 100%; +} + +<===> +================================================================================ +<===> foreign/lightness/input.scss +@use "sass:color"; +a {b: color.channel(pink, "lightness", $space: hsl)} + +<===> foreign/lightness/output.css +a { + b: 87.6470588235%; +} diff --git a/spec/core_functions/color/channel/hwb.hrx b/spec/core_functions/color/channel/hwb.hrx new file mode 100644 index 0000000000..2b52eb80cd --- /dev/null +++ b/spec/core_functions/color/channel/hwb.hrx @@ -0,0 +1,85 @@ +<===> local/hue/input.scss +@use "sass:color"; +a {b: color.channel(hwb(10 30% 40%), "hue")} + +<===> local/hue/output.css +a { + b: 10deg; +} + +<===> +================================================================================ +<===> local/whiteness/input.scss +@use "sass:color"; +a {b: color.channel(hwb(10deg 30% 40%), "whiteness")} + +<===> local/whiteness/output.css +a { + b: 30%; +} + +<===> +================================================================================ +<===> local/blackness/input.scss +@use "sass:color"; +a {b: color.channel(hwb(10deg 30% 40%), "blackness")} + +<===> local/blackness/output.css +a { + b: 40%; +} + +<===> +================================================================================ +<===> local/normalized/whiteness/input.scss +@use "sass:color"; +a {b: color.channel(hwb(10deg 70% 50%), "whiteness")} + +<===> local/normalized/whiteness/output.css +a { + b: 58.3333333333%; +} + +<===> +================================================================================ +<===> local/normalized/blackness/input.scss +@use "sass:color"; +a {b: color.channel(hwb(10deg 70% 50%), "blackness")} + +<===> local/normalized/blackness/output.css +a { + b: 41.6666666667%; +} + +<===> +================================================================================ +<===> foreign/hue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "hue", $space: hwb)} + +<===> foreign/hue/output.css +a { + b: 349.5238095238deg; +} + +<===> +================================================================================ +<===> foreign/whiteness/input.scss +@use "sass:color"; +a {b: color.channel(pink, "whiteness", $space: hwb)} + +<===> foreign/whiteness/output.css +a { + b: 75.2941176471%; +} + +<===> +================================================================================ +<===> foreign/blackness/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blackness", $space: hwb)} + +<===> foreign/blackness/output.css +a { + b: 0%; +} diff --git a/spec/core_functions/color/channel/lab.hrx b/spec/core_functions/color/channel/lab.hrx new file mode 100644 index 0000000000..027b517bbd --- /dev/null +++ b/spec/core_functions/color/channel/lab.hrx @@ -0,0 +1,63 @@ +<===> local/lightness/input.scss +@use "sass:color"; +a {b: color.channel(lab(50 -150 30), "lightness")} + +<===> local/lightness/output.css +a { + b: 50%; +} + +<===> +================================================================================ +<===> local/a/input.scss +@use "sass:color"; +a {b: color.channel(lab(50% -150 30), "a")} + +<===> local/a/output.css +a { + b: -150; +} + +<===> +================================================================================ +<===> local/b/input.scss +@use "sass:color"; +a {b: color.channel(lab(50% -150 30), "b")} + +<===> local/b/output.css +a { + b: 30; +} + +<===> +================================================================================ +<===> foreign/lightness/input.scss +@use "sass:color"; +a {b: color.channel(pink, "lightness", $space: lab)} + +<===> foreign/lightness/output.css +a { + b: 83.7872528656%; +} + +<===> +================================================================================ +<===> foreign/a/input.scss +@use "sass:color"; +a {b: color.channel(pink, "a", $space: lab)} + +<===> foreign/a/output.css +a { + b: 24.4367702881; +} + +<===> +================================================================================ +<===> foreign/b/input.scss +@use "sass:color"; +a {b: color.channel(pink, "b", $space: lab)} + +<===> foreign/b/output.css +a { + b: 3.7594237161; +} diff --git a/spec/core_functions/color/channel/lch.hrx b/spec/core_functions/color/channel/lch.hrx new file mode 100644 index 0000000000..3672227bca --- /dev/null +++ b/spec/core_functions/color/channel/lch.hrx @@ -0,0 +1,63 @@ +<===> local/lightness/input.scss +@use "sass:color"; +a {b: color.channel(lch(50 80% 0.5turn), "lightness")} + +<===> local/lightness/output.css +a { + b: 50%; +} + +<===> +================================================================================ +<===> local/a/input.scss +@use "sass:color"; +a {b: color.channel(lch(50 80% 0.5turn), "chroma")} + +<===> local/a/output.css +a { + b: 120; +} + +<===> +================================================================================ +<===> local/b/input.scss +@use "sass:color"; +a {b: color.channel(lch(50 80% 0.5turn), "hue")} + +<===> local/b/output.css +a { + b: 180deg; +} + +<===> +================================================================================ +<===> foreign/lightness/input.scss +@use "sass:color"; +a {b: color.channel(pink, "lightness", $space: lch)} + +<===> foreign/lightness/output.css +a { + b: 83.7872528656%; +} + +<===> +================================================================================ +<===> foreign/chroma/input.scss +@use "sass:color"; +a {b: color.channel(pink, "chroma", $space: lch)} + +<===> foreign/chroma/output.css +a { + b: 24.7242595195; +} + +<===> +================================================================================ +<===> foreign/hue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "hue", $space: lch)} + +<===> foreign/hue/output.css +a { + b: 8.7459803895deg; +} diff --git a/spec/core_functions/color/channel/missing.hrx b/spec/core_functions/color/channel/missing.hrx new file mode 100644 index 0000000000..82071d88a8 --- /dev/null +++ b/spec/core_functions/color/channel/missing.hrx @@ -0,0 +1,9 @@ +<===> input.scss +@use "sass:color"; +a {b: color.channel(rgb(255 none 255), "green")} + +<===> output.css +a { + b: 0; +} + diff --git a/spec/core_functions/color/channel/named.hrx b/spec/core_functions/color/channel/named.hrx new file mode 100644 index 0000000000..a2e28b8972 --- /dev/null +++ b/spec/core_functions/color/channel/named.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.channel($color: pink, $channel: "hue", $space: hsl)} + +<===> output.css +a { + b: 349.5238095238deg; +} diff --git a/spec/core_functions/color/channel/oklab.hrx b/spec/core_functions/color/channel/oklab.hrx new file mode 100644 index 0000000000..fc84df0cc0 --- /dev/null +++ b/spec/core_functions/color/channel/oklab.hrx @@ -0,0 +1,63 @@ +<===> local/lightness/input.scss +@use "sass:color"; +a {b: color.channel(oklab(0.5 -1 50%), "lightness")} + +<===> local/lightness/output.css +a { + b: 50%; +} + +<===> +================================================================================ +<===> local/a/input.scss +@use "sass:color"; +a {b: color.channel(oklab(0.5 -1 50%), "a")} + +<===> local/a/output.css +a { + b: -1; +} + +<===> +================================================================================ +<===> local/b/input.scss +@use "sass:color"; +a {b: color.channel(oklab(0.5 -1 50%), "b")} + +<===> local/b/output.css +a { + b: 0.2; +} + +<===> +================================================================================ +<===> foreign/lightness/input.scss +@use "sass:color"; +a {b: color.channel(pink, "lightness", $space: oklab)} + +<===> foreign/lightness/output.css +a { + b: 86.7738445294%; +} + +<===> +================================================================================ +<===> foreign/a/input.scss +@use "sass:color"; +a {b: color.channel(pink, "a", $space: oklab)} + +<===> foreign/a/output.css +a { + b: 0.0729803698; +} + +<===> +================================================================================ +<===> foreign/b/input.scss +@use "sass:color"; +a {b: color.channel(pink, "b", $space: oklab)} + +<===> foreign/b/output.css +a { + b: 0.0090714488; +} diff --git a/spec/core_functions/color/channel/oklch.hrx b/spec/core_functions/color/channel/oklch.hrx new file mode 100644 index 0000000000..e9987c9483 --- /dev/null +++ b/spec/core_functions/color/channel/oklch.hrx @@ -0,0 +1,63 @@ +<===> local/lightness/input.scss +@use "sass:color"; +a {b: color.channel(oklch(0.3 80% 30), "lightness")} + +<===> local/lightness/output.css +a { + b: 30%; +} + +<===> +================================================================================ +<===> local/a/input.scss +@use "sass:color"; +a {b: color.channel(oklch(0.3 80% 30), "chroma")} + +<===> local/a/output.css +a { + b: 0.32; +} + +<===> +================================================================================ +<===> local/b/input.scss +@use "sass:color"; +a {b: color.channel(oklch(0.3 80% 30), "hue")} + +<===> local/b/output.css +a { + b: 30deg; +} + +<===> +================================================================================ +<===> foreign/lightness/input.scss +@use "sass:color"; +a {b: color.channel(pink, "lightness", $space: oklch)} + +<===> foreign/lightness/output.css +a { + b: 86.7738445294%; +} + +<===> +================================================================================ +<===> foreign/chroma/input.scss +@use "sass:color"; +a {b: color.channel(pink, "chroma", $space: oklch)} + +<===> foreign/chroma/output.css +a { + b: 0.0735419986; +} + +<===> +================================================================================ +<===> foreign/hue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "hue", $space: oklch)} + +<===> foreign/hue/output.css +a { + b: 7.0855142734deg; +} diff --git a/spec/core_functions/color/channel/positional.hrx b/spec/core_functions/color/channel/positional.hrx new file mode 100644 index 0000000000..b1aeb10f4b --- /dev/null +++ b/spec/core_functions/color/channel/positional.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.channel(oklch(60% 70% 0.6turn), "red", rgb)} + +<===> output.css +a { + b: -143.1028884453; +} diff --git a/spec/core_functions/color/channel/prophoto-rgb.hrx b/spec/core_functions/color/channel/prophoto-rgb.hrx new file mode 100644 index 0000000000..23ddb0ad6c --- /dev/null +++ b/spec/core_functions/color/channel/prophoto-rgb.hrx @@ -0,0 +1,63 @@ +<===> local/red/input.scss +@use "sass:color"; +a {b: color.channel(color(prophoto-rgb 0.2 0.5 0.8), "red")} + +<===> local/red/output.css +a { + b: 0.2; +} + +<===> +================================================================================ +<===> local/green/input.scss +@use "sass:color"; +a {b: color.channel(color(prophoto-rgb 0.2 0.5 0.8), "green")} + +<===> local/green/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/blue/input.scss +@use "sass:color"; +a {b: color.channel(color(prophoto-rgb 0.2 0.5 0.8), "blue")} + +<===> local/blue/output.css +a { + b: 0.8; +} + +<===> +================================================================================ +<===> foreign/red/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", $space: prophoto-rgb)} + +<===> foreign/red/output.css +a { + b: 0.8755603733; +} + +<===> +================================================================================ +<===> foreign/green/input.scss +@use "sass:color"; +a {b: color.channel(pink, "green", $space: prophoto-rgb)} + +<===> foreign/green/output.css +a { + b: 0.7357592889; +} + +<===> +================================================================================ +<===> foreign/blue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blue", $space: prophoto-rgb)} + +<===> foreign/blue/output.css +a { + b: 0.7499576055; +} diff --git a/spec/core_functions/color/channel/rec2020.hrx b/spec/core_functions/color/channel/rec2020.hrx new file mode 100644 index 0000000000..ed636db547 --- /dev/null +++ b/spec/core_functions/color/channel/rec2020.hrx @@ -0,0 +1,63 @@ +<===> local/red/input.scss +@use "sass:color"; +a {b: color.channel(color(rec2020 0.2 0.5 0.8), "red")} + +<===> local/red/output.css +a { + b: 0.2; +} + +<===> +================================================================================ +<===> local/green/input.scss +@use "sass:color"; +a {b: color.channel(color(rec2020 0.2 0.5 0.8), "green")} + +<===> local/green/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/blue/input.scss +@use "sass:color"; +a {b: color.channel(color(rec2020 0.2 0.5 0.8), "blue")} + +<===> local/blue/output.css +a { + b: 0.8; +} + +<===> +================================================================================ +<===> foreign/red/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", $space: rec2020)} + +<===> foreign/red/output.css +a { + b: 0.9098509852; +} + +<===> +================================================================================ +<===> foreign/green/input.scss +@use "sass:color"; +a {b: color.channel(pink, "green", $space: rec2020)} + +<===> foreign/green/output.css +a { + b: 0.747938727; +} + +<===> +================================================================================ +<===> foreign/blue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blue", $space: rec2020)} + +<===> foreign/blue/output.css +a { + b: 0.7726929727; +} diff --git a/spec/core_functions/color/channel/rgb.hrx b/spec/core_functions/color/channel/rgb.hrx new file mode 100644 index 0000000000..339047ff87 --- /dev/null +++ b/spec/core_functions/color/channel/rgb.hrx @@ -0,0 +1,63 @@ +<===> local/red/input.scss +@use "sass:color"; +a {b: color.channel(#abcdef, "red")} + +<===> local/red/output.css +a { + b: 171; +} + +<===> +================================================================================ +<===> local/green/input.scss +@use "sass:color"; +a {b: color.channel(#abcdef, "green")} + +<===> local/green/output.css +a { + b: 205; +} + +<===> +================================================================================ +<===> local/blue/input.scss +@use "sass:color"; +a {b: color.channel(#abcdef, "blue")} + +<===> local/blue/output.css +a { + b: 239; +} + +<===> +================================================================================ +<===> foreign/red/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red")} + +<===> foreign/red/output.css +a { + b: 255; +} + +<===> +================================================================================ +<===> foreign/green/input.scss +@use "sass:color"; +a {b: color.channel(pink, "green")} + +<===> foreign/green/output.css +a { + b: 192; +} + +<===> +================================================================================ +<===> foreign/blue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blue")} + +<===> foreign/blue/output.css +a { + b: 203; +} diff --git a/spec/core_functions/color/channel/srgb-linear.hrx b/spec/core_functions/color/channel/srgb-linear.hrx new file mode 100644 index 0000000000..855d017f8f --- /dev/null +++ b/spec/core_functions/color/channel/srgb-linear.hrx @@ -0,0 +1,63 @@ +<===> local/red/input.scss +@use "sass:color"; +a {b: color.channel(color(srgb-linear 0.2 0.5 0.8), "red")} + +<===> local/red/output.css +a { + b: 0.2; +} + +<===> +================================================================================ +<===> local/green/input.scss +@use "sass:color"; +a {b: color.channel(color(srgb-linear 0.2 0.5 0.8), "green")} + +<===> local/green/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/blue/input.scss +@use "sass:color"; +a {b: color.channel(color(srgb-linear 0.2 0.5 0.8), "blue")} + +<===> local/blue/output.css +a { + b: 0.8; +} + +<===> +================================================================================ +<===> foreign/red/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", $space: srgb-linear)} + +<===> foreign/red/output.css +a { + b: 1; +} + +<===> +================================================================================ +<===> foreign/green/input.scss +@use "sass:color"; +a {b: color.channel(pink, "green", $space: srgb-linear)} + +<===> foreign/green/output.css +a { + b: 0.5271151257; +} + +<===> +================================================================================ +<===> foreign/blue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blue", $space: srgb-linear)} + +<===> foreign/blue/output.css +a { + b: 0.5972017884; +} diff --git a/spec/core_functions/color/channel/srgb.hrx b/spec/core_functions/color/channel/srgb.hrx new file mode 100644 index 0000000000..253a0905c2 --- /dev/null +++ b/spec/core_functions/color/channel/srgb.hrx @@ -0,0 +1,63 @@ +<===> local/red/input.scss +@use "sass:color"; +a {b: color.channel(color(srgb 0.2 0.5 0.8), "red")} + +<===> local/red/output.css +a { + b: 0.2; +} + +<===> +================================================================================ +<===> local/green/input.scss +@use "sass:color"; +a {b: color.channel(color(srgb 0.2 0.5 0.8), "green")} + +<===> local/green/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/blue/input.scss +@use "sass:color"; +a {b: color.channel(color(srgb 0.2 0.5 0.8), "blue")} + +<===> local/blue/output.css +a { + b: 0.8; +} + +<===> +================================================================================ +<===> foreign/red/input.scss +@use "sass:color"; +a {b: color.channel(pink, "red", $space: srgb)} + +<===> foreign/red/output.css +a { + b: 1; +} + +<===> +================================================================================ +<===> foreign/green/input.scss +@use "sass:color"; +a {b: color.channel(pink, "green", $space: srgb)} + +<===> foreign/green/output.css +a { + b: 0.7529411765; +} + +<===> +================================================================================ +<===> foreign/blue/input.scss +@use "sass:color"; +a {b: color.channel(pink, "blue", $space: srgb)} + +<===> foreign/blue/output.css +a { + b: 0.7960784314; +} diff --git a/spec/core_functions/color/channel/xyz-d50.hrx b/spec/core_functions/color/channel/xyz-d50.hrx new file mode 100644 index 0000000000..aecd360bc7 --- /dev/null +++ b/spec/core_functions/color/channel/xyz-d50.hrx @@ -0,0 +1,63 @@ +<===> local/x/input.scss +@use "sass:color"; +a {b: color.channel(color(xyz-d50 -0.2 0.5 1.8), "x")} + +<===> local/x/output.css +a { + b: -0.2; +} + +<===> +================================================================================ +<===> local/y/input.scss +@use "sass:color"; +a {b: color.channel(color(xyz-d50 -0.2 0.5 1.8), "y")} + +<===> local/y/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/z/input.scss +@use "sass:color"; +a {b: color.channel(color(xyz-d50 -0.2 0.5 1.8), "z")} + +<===> local/z/output.css +a { + b: 1.8; +} + +<===> +================================================================================ +<===> foreign/x/input.scss +@use "sass:color"; +a {b: color.channel(pink, "x", $space: xyz-d50)} + +<===> foreign/x/output.css +a { + b: 0.7245316215; +} + +<===> +================================================================================ +<===> foreign/y/input.scss +@use "sass:color"; +a {b: color.channel(pink, "y", $space: xyz-d50)} + +<===> foreign/y/output.css +a { + b: 0.636577424; +} + +<===> +================================================================================ +<===> foreign/z/input.scss +@use "sass:color"; +a {b: color.channel(pink, "z", $space: xyz-d50)} + +<===> foreign/z/output.css +a { + b: 0.4915583688; +} diff --git a/spec/core_functions/color/channel/xyz.hrx b/spec/core_functions/color/channel/xyz.hrx new file mode 100644 index 0000000000..2c2ea7a5c7 --- /dev/null +++ b/spec/core_functions/color/channel/xyz.hrx @@ -0,0 +1,63 @@ +<===> local/x/input.scss +@use "sass:color"; +a {b: color.channel(color(xyz-d65 -0.2 0.5 1.8), "x")} + +<===> local/x/output.css +a { + b: -0.2; +} + +<===> +================================================================================ +<===> local/y/input.scss +@use "sass:color"; +a {b: color.channel(color(xyz-d65 -0.2 0.5 1.8), "y")} + +<===> local/y/output.css +a { + b: 0.5; +} + +<===> +================================================================================ +<===> local/z/input.scss +@use "sass:color"; +a {b: color.channel(color(xyz-d65 -0.2 0.5 1.8), "z")} + +<===> local/z/output.css +a { + b: 1.8; +} + +<===> +================================================================================ +<===> foreign/x/input.scss +@use "sass:color"; +a {b: color.channel(pink, "x", $space: xyz)} + +<===> foreign/x/output.css +a { + b: 0.7086623629; +} + +<===> +================================================================================ +<===> foreign/y/input.scss +@use "sass:color"; +a {b: color.channel(pink, "y", $space: xyz)} + +<===> foreign/y/output.css +a { + b: 0.6327286137; +} + +<===> +================================================================================ +<===> foreign/z/input.scss +@use "sass:color"; +a {b: color.channel(pink, "z", $space: xyz)} + +<===> foreign/z/output.css +a { + b: 0.6498196913; +} diff --git a/spec/core_functions/color/color/README.md b/spec/core_functions/color/color/README.md new file mode 100644 index 0000000000..5117c908e1 --- /dev/null +++ b/spec/core_functions/color/color/README.md @@ -0,0 +1,2 @@ +Some of the same behavior tested for `lab()` applies to this function as well, +but for terseness' sake isn't tested explicitly. diff --git a/spec/core_functions/color/color/alpha.hrx b/spec/core_functions/color/color/alpha.hrx new file mode 100644 index 0000000000..b662311034 --- /dev/null +++ b/spec/core_functions/color/color/alpha.hrx @@ -0,0 +1,155 @@ +<===> transparent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3 / 0)); + +<===> transparent/output.css +a { + value: color(srgb 0.1 0.2 0.3 / 0); + space: srgb; + channels: 0.1 0.2 0.3 / 0; +} + +<===> +================================================================================ +<===> opaque/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3 / 1)); + +<===> opaque/output.css +a { + value: color(srgb 0.1 0.2 0.3); + space: srgb; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> partial/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3 / 0.4)); + +<===> partial/output.css +a { + value: color(srgb 0.1 0.2 0.3 / 0.4); + space: srgb; + channels: 0.1 0.2 0.3 / 0.4; +} + +<===> +================================================================================ +<===> percent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3 / 40%)); + +<===> percent/output.css +a { + value: color(srgb 0.1 0.2 0.3 / 0.4); + space: srgb; + channels: 0.1 0.2 0.3 / 0.4; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color($description: srgb 0.1 0.2 0.3 / 0.4)); + +<===> named/output.css +a { + value: color(srgb 0.1 0.2 0.3 / 0.4); + space: srgb; + channels: 0.1 0.2 0.3 / 0.4; +} + +<===> +================================================================================ +<===> slash_list/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(color(list.slash(srgb 0.1 0.2 0.3, 0.4))); + +<===> slash_list/output.css +a { + value: color(srgb 0.1 0.2 0.3 / 0.4); + space: srgb; + channels: 0.1 0.2 0.3 / 0.4; +} + +<===> +================================================================================ +<===> none/slash/blue/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 none / 0.4)); + +<===> none/slash/blue/output.css +a { + value: color(srgb 0.1 0.2 none / 0.4); + space: srgb; + channels: 0.1 0.2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3 / none)); + +<===> none/slash/alpha/output.css +a { + value: color(srgb 0.1 0.2 0.3 / none); + space: srgb; + channels: 0.1 0.2 0.3 / none; +} + +<===> +================================================================================ +<===> none/slash_list/blue/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(color(list.slash(srgb 0.1 0.2 none, 0.4))); + +<===> none/slash_list/blue/output.css +a { + value: color(srgb 0.1 0.2 none / 0.4); + space: srgb; + channels: 0.1 0.2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash_list/alpha/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(color(list.slash(srgb 0.1 0.2 0.3, none))); + +<===> none/slash_list/alpha/output.css +a { + value: color(srgb 0.1 0.2 0.3 / none); + space: srgb; + channels: 0.1 0.2 0.3 / none; +} + +<===> +================================================================================ +<===> relative_color/slash/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(from #aaa srgb r g b / 25%)); + +<===> relative_color/slash/output.css +a { + value: color(from #aaa srgb r g b/25%); + type: string; +} + +<===> +================================================================================ +<===> relative_color/slash_list/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(color(list.slash(from #aaa srgb r g b, 25%))); + +<===> relative_color/slash_list/output.css +a { + value: color(from #aaa srgb r g b / 25%); + type: string; +} diff --git a/spec/core_functions/color/color/degenerate.hrx b/spec/core_functions/color/color/degenerate.hrx new file mode 100644 index 0000000000..0f2d8b88bc --- /dev/null +++ b/spec/core_functions/color/color/degenerate.hrx @@ -0,0 +1,87 @@ +<===> arg1/positive_infinity/input.scss +a {b: color(srgb calc(infinity) 0 0)} + +<===> arg1/positive_infinity/output.css +a { + b: color(srgb calc(infinity) 0 0); +} + +<===> +================================================================================ +<===> arg1/negative_infinity/input.scss +a {b: color(srgb calc(-infinity) 0 0)} + +<===> arg1/negative_infinity/output.css +a { + b: color(srgb calc(-infinity) 0 0); +} + +<===> +================================================================================ +<===> arg1/nan/input.scss +a {b: color(srgb calc(NaN) 0 0)} + +<===> arg1/nan/output.css +a { + b: color(srgb calc(NaN) 0 0); +} + +<===> +================================================================================ +<===> before_alpha/positive_infinity/input.scss +a {b: color(srgb 0 0 calc(infinity) / 0.5)} + +<===> before_alpha/positive_infinity/output.css +a { + b: color(srgb 0 0 calc(infinity) / 0.5); +} + +<===> +================================================================================ +<===> before_alpha/negative_infinity/input.scss +a {b: color(srgb 0 0 calc(-infinity) / 0.5)} + +<===> before_alpha/negative_infinity/output.css +a { + b: color(srgb 0 0 calc(-infinity) / 0.5); +} + +<===> +================================================================================ +<===> before_alpha/nan/input.scss +a {b: color(srgb 0 0 calc(NaN) / 0.5)} + +<===> before_alpha/nan/output.css +a { + b: color(srgb 0 0 calc(NaN) / 0.5); +} + +<===> +================================================================================ +<===> alpha/positive_infinity/input.scss +a {b: color(srgb 0 0 0 / calc(infinity))} + +<===> alpha/positive_infinity/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> alpha/negative_infinity/input.scss +a {b: color(srgb 0 0 0 / calc(-infinity))} + +<===> alpha/negative_infinity/output.css +a { + b: color(srgb 0 0 0 / 0); +} + +<===> +================================================================================ +<===> alpha/nan/input.scss +a {b: color(srgb 0 0 0 / calc(NaN))} + +<===> alpha/nan/output.css +a { + b: color(srgb 0 0 0 / 0); +} diff --git a/spec/core_functions/color/color/error.hrx b/spec/core_functions/color/color/error.hrx new file mode 100644 index 0000000000..e6b1bd1809 --- /dev/null +++ b/spec/core_functions/color/color/error.hrx @@ -0,0 +1,331 @@ +<===> unit/red/input.scss +a {b: color(srgb 0.1px 0.2 0.3)} + +<===> unit/red/error +Error: $red: Expected 0.1px to have unit "%" or no units. + , +1 | a {b: color(srgb 0.1px 0.2 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/green/input.scss +a {b: color(srgb 0.1 0.2px 0.3)} + +<===> unit/green/error +Error: $green: Expected 0.2px to have unit "%" or no units. + , +1 | a {b: color(srgb 0.1 0.2px 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/blue/input.scss +a {b: color(srgb 0.1 0.2 0.3px)} + +<===> unit/blue/error +Error: $blue: Expected 0.3px to have unit "%" or no units. + , +1 | a {b: color(srgb 0.1 0.2 0.3px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash/input.scss +a {b: color(srgb 0.1 0.2 0.3/0.4px)} + +<===> unit/alpha/slash/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +1 | a {b: color(srgb 0.1 0.2 0.3/0.4px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: color(list.slash(srgb 0.1 0.2 0.3, 0.4px))} + +<===> unit/alpha/slash_list/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +2 | a {b: color(list.slash(srgb 0.1 0.2 0.3, 0.4px))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/red/input.scss +a {b: color(srgb c 0.2 0.3)} + +<===> type/red/error +Error: $description: Expected red channel to be a number, was c. + , +1 | a {b: color(srgb c 0.2 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/green/input.scss +a {b: color(srgb 0.1 c 0.3)} + +<===> type/green/error +Error: $description: Expected green channel to be a number, was c. + , +1 | a {b: color(srgb 0.1 c 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/blue/input.scss +a {b: color(srgb 0.1 0.2 c)} + +<===> type/blue/error +Error: $description: Expected blue channel to be a number, was c. + , +1 | a {b: color(srgb 0.1 0.2 c)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: color(list.slash(srgb 0.1 0.2 0.3, c))} + +<===> type/alpha/slash_list/error +Error: $description: c is not a number. + , +2 | a {b: color(list.slash(srgb 0.1 0.2 0.3, c))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/bracketed/input.scss +a {b: color([srgb 0.1 0.2 0.3])} + +<===> list/bracketed/error +Error: $description: Expected an unbracketed list, was [srgb 0.1 0.2 0.3] + , +1 | a {b: color([srgb 0.1 0.2 0.3])} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/comma/input.scss +a {b: color((srgb, 0.1, 0.2, 0.3))} + +<===> list/comma/error +Error: $description: Expected a space- or slash-separated list, was (srgb, 0.1, 0.2, 0.3) + , +1 | a {b: color((srgb, 0.1, 0.2, 0.3))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/three/input.scss +@use 'sass:list'; +a {b: color(list.slash(srgb 0.1, 0.2, 0.3))} + +<===> list/slash/three/error +Error: $description: Only 2 slash-separated elements allowed, but 3 were passed. + , +2 | a {b: color(list.slash(srgb 0.1, 0.2, 0.3))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/one/input.scss +@use 'sass:list'; +$single-arg-slash-separated: list.append((), srgb 0.1 0.2 0.3, $separator: slash); +a {b: color($single-arg-slash-separated)} + +<===> list/slash/one/error +Error: $description: Only 2 slash-separated elements allowed, but 1 was passed. + , +3 | a {b: color($single-arg-slash-separated)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/after_space/input.scss +a {b: color(srgb (0.1 0.2 0.3))} + +<===> list/after_space/error +Error: $description: Expected red channel to be a number, was (0.1 0.2 0.3). + , +1 | a {b: color(srgb (0.1 0.2 0.3))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/too_few_channels/input.scss +a {b: color(srgb 0.1 0.2)} + +<===> list/too_few_channels/error +Error: $description: The srgb color space has 3 channels but (srgb 0.1 0.2) has 2. + , +1 | a {b: color(srgb 0.1 0.2)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/too_many_channels/input.scss +a {b: color(srgb 0.1 0.2 0.3 0.4)} + +<===> list/too_many_channels/error +Error: $description: The srgb color space has 3 channels but (srgb 0.1 0.2 0.3 0.4) has 4. + , +1 | a {b: color(srgb 0.1 0.2 0.3 0.4)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/no_channels/input.scss +a {b: color(srgb)} + +<===> too_few_args/no_channels/error +Error: $description: The srgb color space has 3 channels but srgb has 0. + , +1 | a {b: color(srgb)} + | ^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/no_space/input.scss +a {b: color(1 2 3)} + +<===> too_few_args/no_space/error +Error: $description: 1 is not a string. + , +1 | a {b: color(1 2 3)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/none/input.scss +a {b: color()} + +<===> too_few_args/none/error +Error: Missing argument $description. + ,--> input.scss +1 | a {b: color()} + | ^^^^^^^ invocation + ' + ,--> sass:color +1 | @function color($description) { + | =================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +a {b: color(srgb 0.1 0.2 0.3 0.4)} + +<===> too_many_args/error +Error: $description: The srgb color space has 3 channels but (srgb 0.1 0.2 0.3 0.4) has 4. + , +1 | a {b: color(srgb 0.1 0.2 0.3 0.4)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unknown_space/input.scss +a {b: color(foo 1 2 3)} + +<===> unknown_space/error +Error: $description: Unknown color space "foo". + , +1 | a {b: color(foo 1 2 3)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/quoted/alpha/input.scss +a {b: color("from" #aaa srgb r g b / 25%)} + +<===> relative_color/quoted/alpha/error +Error: $description: Expected "from" to be an unquoted string. + , +1 | a {b: color("from" #aaa srgb r g b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/quoted/no_alpha/input.scss +a {b: color("from" #aaa srgb r g b)} + +<===> relative_color/quoted/no_alpha/error +Error: $description: Expected "from" to be an unquoted string. + , +1 | a {b: color("from" #aaa srgb r g b)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/wrong_keyword/alpha/input.scss +a {b: color(c #aaa srgb r g b / 25%)} + +<===> relative_color/wrong_keyword/alpha/error +Error: $description: Unknown color space "c". + , +1 | a {b: color(c #aaa srgb r g b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/wrong_keyword/no_alpha/input.scss +a {b: color(c #aaa srgb r g b)} + +<===> relative_color/wrong_keyword/no_alpha/error +Error: $description: Unknown color space "c". + , +1 | a {b: color(c #aaa srgb r g b)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/color/no_alpha.hrx b/spec/core_functions/color/color/no_alpha.hrx new file mode 100644 index 0000000000..f5318ef2dd --- /dev/null +++ b/spec/core_functions/color/color/no_alpha.hrx @@ -0,0 +1,74 @@ +<===> none/red/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb none 0.2 0.3)); + +<===> none/red/output.css +a { + value: color(srgb none 0.2 0.3); + space: srgb; + channels: none 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> none/green/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 none 0.3)); + +<===> none/green/output.css +a { + value: color(srgb 0.1 none 0.3); + space: srgb; + channels: 0.1 none 0.3 / 1; +} + +<===> +================================================================================ +<===> none/blue/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 none 0.3)); + +<===> none/blue/output.css +a { + value: color(srgb 0.1 none 0.3); + space: srgb; + channels: 0.1 none 0.3 / 1; +} + +<===> +================================================================================ +<===> case/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(sRGB 0.1 none 0.3)); + +<===> case/output.css +a { + value: color(srgb 0.1 none 0.3); + space: srgb; + channels: 0.1 none 0.3 / 1; +} + +<===> +================================================================================ +<===> relative_color/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(from #aaa srgb r g b)); + +<===> relative_color/output.css +a { + value: color(from #aaa srgb r g b); + type: string; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color($description: srgb 0.1 0.2 0.3)); + +<===> named/output.css +a { + value: color(srgb 0.1 0.2 0.3); + space: srgb; + channels: 0.1 0.2 0.3 / 1; +} diff --git a/spec/core_functions/color/color/relative_color.hrx b/spec/core_functions/color/color/relative_color.hrx new file mode 100644 index 0000000000..5407f9ea3e --- /dev/null +++ b/spec/core_functions/color/color/relative_color.hrx @@ -0,0 +1,88 @@ +<===> static/alpha/input.scss +a {b: color(from #aaa srgb r g b / 25%)} + +<===> static/alpha/output.css +a { + b: color(from #aaa srgb r g b/25%); +} + +<===> +================================================================================ +<===> static/no_alpha/input.scss +a {b: color(from #aaa srgb r g b)} + +<===> static/no_alpha/output.css +a { + b: color(from #aaa srgb r g b); +} + +<===> +================================================================================ +<===> calc/alpha/input.scss +a {b: color(from #aaa srgb calc(l + 0.2) a b / 25%)} + +<===> calc/alpha/output.css +a { + b: color(from #aaa srgb calc(l + 0.2) a b/25%); +} + +<===> +================================================================================ +<===> calc/no_alpha/input.scss +a {b: color(from #aaa srgb calc(l + 0.2) a b)} + +<===> calc/no_alpha/output.css +a { + b: color(from #aaa srgb calc(l + 0.2) a b); +} + +<===> +================================================================================ +<===> var/alpha/input.scss +a {b: color(from var(--c) srgb r g b / 25%)} + +<===> var/alpha/output.css +a { + b: color(from var(--c) srgb r g b/25%); +} + +<===> +================================================================================ +<===> var/no_alpha/input.scss +a {b: color(from var(--c) srgb r g b)} + +<===> var/no_alpha/output.css +a { + b: color(from var(--c) srgb r g b); +} + +<===> +================================================================================ +<===> different_case/alpha/input.scss +a {b: color(From #aaa srgb r g b / 25%)} + +<===> different_case/alpha/output.css +a { + b: color(From #aaa srgb r g b/25%); +} + +<===> +================================================================================ +<===> different_case/no_alpha/input.scss +a {b: color(From #aaa srgb r g b)} + +<===> different_case/no_alpha/output.css +a { + b: color(From #aaa srgb r g b); +} + +<===> +================================================================================ +<===> slash_list_alpha/input.scss +@use "sass:list"; +a {b: color(list.slash(from #aaa srgb r g b, 25%))} + +<===> slash_list_alpha/output.css +a { + b: color(from #aaa srgb r g b / 25%); +} diff --git a/spec/core_functions/color/color/spaces/a98_rgb.hrx b/spec/core_functions/color/color/spaces/a98_rgb.hrx new file mode 100644 index 0000000000..877efcd52f --- /dev/null +++ b/spec/core_functions/color/color/spaces/a98_rgb.hrx @@ -0,0 +1,179 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(a98-rgb 0.1 0.2 0.3); + space: a98-rgb; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 1.1 0.2 0.3)); + +<===> unitless/red/above_range/output.css +a { + value: color(a98-rgb 1.1 0.2 0.3); + space: a98-rgb; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb -0.1 0.2 0.3)); + +<===> unitless/red/below_range/output.css +a { + value: color(a98-rgb -0.1 0.2 0.3); + space: a98-rgb; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 1.2 0.3)); + +<===> unitless/green/above_range/output.css +a { + value: color(a98-rgb 0.1 1.2 0.3); + space: a98-rgb; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 -0.2 0.3)); + +<===> unitless/green/below_range/output.css +a { + value: color(a98-rgb 0.1 -0.2 0.3); + space: a98-rgb; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 0.2 1.3)); + +<===> unitless/blue/above_range/output.css +a { + value: color(a98-rgb 0.1 0.2 1.3); + space: a98-rgb; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 0.2 -0.3)); + +<===> unitless/blue/below_range/output.css +a { + value: color(a98-rgb 0.1 0.2 -0.3); + space: a98-rgb; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(a98-rgb 0.1 0.2 0.3); + space: a98-rgb; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 110% 0.2 0.3)); + +<===> percent/red/above_range/output.css +a { + value: color(a98-rgb 1.1 0.2 0.3); + space: a98-rgb; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb -10% 0.2 0.3)); + +<===> percent/red/below_range/output.css +a { + value: color(a98-rgb -0.1 0.2 0.3); + space: a98-rgb; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 120% 0.3)); + +<===> percent/green/above_range/output.css +a { + value: color(a98-rgb 0.1 1.2 0.3); + space: a98-rgb; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 -20% 0.3)); + +<===> percent/green/below_range/output.css +a { + value: color(a98-rgb 0.1 -0.2 0.3); + space: a98-rgb; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 0.2 130%)); + +<===> percent/blue/above_range/output.css +a { + value: color(a98-rgb 0.1 0.2 1.3); + space: a98-rgb; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(a98-rgb 0.1 0.2 -30%)); + +<===> percent/blue/below_range/output.css +a { + value: color(a98-rgb 0.1 0.2 -0.3); + space: a98-rgb; + channels: 0.1 0.2 -0.3 / 1; +} diff --git a/spec/core_functions/color/color/spaces/display_p3.hrx b/spec/core_functions/color/color/spaces/display_p3.hrx new file mode 100644 index 0000000000..91c495833b --- /dev/null +++ b/spec/core_functions/color/color/spaces/display_p3.hrx @@ -0,0 +1,179 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(display-p3 0.1 0.2 0.3); + space: display-p3; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 1.1 0.2 0.3)); + +<===> unitless/red/above_range/output.css +a { + value: color(display-p3 1.1 0.2 0.3); + space: display-p3; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 -0.1 0.2 0.3)); + +<===> unitless/red/below_range/output.css +a { + value: color(display-p3 -0.1 0.2 0.3); + space: display-p3; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 1.2 0.3)); + +<===> unitless/green/above_range/output.css +a { + value: color(display-p3 0.1 1.2 0.3); + space: display-p3; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 -0.2 0.3)); + +<===> unitless/green/below_range/output.css +a { + value: color(display-p3 0.1 -0.2 0.3); + space: display-p3; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 0.2 1.3)); + +<===> unitless/blue/above_range/output.css +a { + value: color(display-p3 0.1 0.2 1.3); + space: display-p3; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 0.2 -0.3)); + +<===> unitless/blue/below_range/output.css +a { + value: color(display-p3 0.1 0.2 -0.3); + space: display-p3; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(display-p3 0.1 0.2 0.3); + space: display-p3; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 110% 0.2 0.3)); + +<===> percent/red/above_range/output.css +a { + value: color(display-p3 1.1 0.2 0.3); + space: display-p3; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 -10% 0.2 0.3)); + +<===> percent/red/below_range/output.css +a { + value: color(display-p3 -0.1 0.2 0.3); + space: display-p3; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 120% 0.3)); + +<===> percent/green/above_range/output.css +a { + value: color(display-p3 0.1 1.2 0.3); + space: display-p3; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 -20% 0.3)); + +<===> percent/green/below_range/output.css +a { + value: color(display-p3 0.1 -0.2 0.3); + space: display-p3; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 0.2 130%)); + +<===> percent/blue/above_range/output.css +a { + value: color(display-p3 0.1 0.2 1.3); + space: display-p3; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(display-p3 0.1 0.2 -30%)); + +<===> percent/blue/below_range/output.css +a { + value: color(display-p3 0.1 0.2 -0.3); + space: display-p3; + channels: 0.1 0.2 -0.3 / 1; +} diff --git a/spec/core_functions/color/color/spaces/prophoto_rgb.hrx b/spec/core_functions/color/color/spaces/prophoto_rgb.hrx new file mode 100644 index 0000000000..67750f549b --- /dev/null +++ b/spec/core_functions/color/color/spaces/prophoto_rgb.hrx @@ -0,0 +1,179 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(prophoto-rgb 0.1 0.2 0.3); + space: prophoto-rgb; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 1.1 0.2 0.3)); + +<===> unitless/red/above_range/output.css +a { + value: color(prophoto-rgb 1.1 0.2 0.3); + space: prophoto-rgb; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb -0.1 0.2 0.3)); + +<===> unitless/red/below_range/output.css +a { + value: color(prophoto-rgb -0.1 0.2 0.3); + space: prophoto-rgb; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 1.2 0.3)); + +<===> unitless/green/above_range/output.css +a { + value: color(prophoto-rgb 0.1 1.2 0.3); + space: prophoto-rgb; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 -0.2 0.3)); + +<===> unitless/green/below_range/output.css +a { + value: color(prophoto-rgb 0.1 -0.2 0.3); + space: prophoto-rgb; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 0.2 1.3)); + +<===> unitless/blue/above_range/output.css +a { + value: color(prophoto-rgb 0.1 0.2 1.3); + space: prophoto-rgb; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 0.2 -0.3)); + +<===> unitless/blue/below_range/output.css +a { + value: color(prophoto-rgb 0.1 0.2 -0.3); + space: prophoto-rgb; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(prophoto-rgb 0.1 0.2 0.3); + space: prophoto-rgb; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 110% 0.2 0.3)); + +<===> percent/red/above_range/output.css +a { + value: color(prophoto-rgb 1.1 0.2 0.3); + space: prophoto-rgb; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb -10% 0.2 0.3)); + +<===> percent/red/below_range/output.css +a { + value: color(prophoto-rgb -0.1 0.2 0.3); + space: prophoto-rgb; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 120% 0.3)); + +<===> percent/green/above_range/output.css +a { + value: color(prophoto-rgb 0.1 1.2 0.3); + space: prophoto-rgb; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 -20% 0.3)); + +<===> percent/green/below_range/output.css +a { + value: color(prophoto-rgb 0.1 -0.2 0.3); + space: prophoto-rgb; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 0.2 130%)); + +<===> percent/blue/above_range/output.css +a { + value: color(prophoto-rgb 0.1 0.2 1.3); + space: prophoto-rgb; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(prophoto-rgb 0.1 0.2 -30%)); + +<===> percent/blue/below_range/output.css +a { + value: color(prophoto-rgb 0.1 0.2 -0.3); + space: prophoto-rgb; + channels: 0.1 0.2 -0.3 / 1; +} diff --git a/spec/core_functions/color/color/spaces/rec2020.hrx b/spec/core_functions/color/color/spaces/rec2020.hrx new file mode 100644 index 0000000000..097ea46652 --- /dev/null +++ b/spec/core_functions/color/color/spaces/rec2020.hrx @@ -0,0 +1,179 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(rec2020 0.1 0.2 0.3); + space: rec2020; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 1.1 0.2 0.3)); + +<===> unitless/red/above_range/output.css +a { + value: color(rec2020 1.1 0.2 0.3); + space: rec2020; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 -0.1 0.2 0.3)); + +<===> unitless/red/below_range/output.css +a { + value: color(rec2020 -0.1 0.2 0.3); + space: rec2020; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 1.2 0.3)); + +<===> unitless/green/above_range/output.css +a { + value: color(rec2020 0.1 1.2 0.3); + space: rec2020; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 -0.2 0.3)); + +<===> unitless/green/below_range/output.css +a { + value: color(rec2020 0.1 -0.2 0.3); + space: rec2020; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 0.2 1.3)); + +<===> unitless/blue/above_range/output.css +a { + value: color(rec2020 0.1 0.2 1.3); + space: rec2020; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 0.2 -0.3)); + +<===> unitless/blue/below_range/output.css +a { + value: color(rec2020 0.1 0.2 -0.3); + space: rec2020; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(rec2020 0.1 0.2 0.3); + space: rec2020; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 110% 0.2 0.3)); + +<===> percent/red/above_range/output.css +a { + value: color(rec2020 1.1 0.2 0.3); + space: rec2020; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 -10% 0.2 0.3)); + +<===> percent/red/below_range/output.css +a { + value: color(rec2020 -0.1 0.2 0.3); + space: rec2020; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 120% 0.3)); + +<===> percent/green/above_range/output.css +a { + value: color(rec2020 0.1 1.2 0.3); + space: rec2020; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 -20% 0.3)); + +<===> percent/green/below_range/output.css +a { + value: color(rec2020 0.1 -0.2 0.3); + space: rec2020; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 0.2 130%)); + +<===> percent/blue/above_range/output.css +a { + value: color(rec2020 0.1 0.2 1.3); + space: rec2020; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(rec2020 0.1 0.2 -30%)); + +<===> percent/blue/below_range/output.css +a { + value: color(rec2020 0.1 0.2 -0.3); + space: rec2020; + channels: 0.1 0.2 -0.3 / 1; +} diff --git a/spec/core_functions/color/color/spaces/srgb.hrx b/spec/core_functions/color/color/spaces/srgb.hrx new file mode 100644 index 0000000000..05e445a7f2 --- /dev/null +++ b/spec/core_functions/color/color/spaces/srgb.hrx @@ -0,0 +1,179 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(srgb 0.1 0.2 0.3); + space: srgb; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 1.1 0.2 0.3)); + +<===> unitless/red/above_range/output.css +a { + value: color(srgb 1.1 0.2 0.3); + space: srgb; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb -0.1 0.2 0.3)); + +<===> unitless/red/below_range/output.css +a { + value: color(srgb -0.1 0.2 0.3); + space: srgb; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 1.2 0.3)); + +<===> unitless/green/above_range/output.css +a { + value: color(srgb 0.1 1.2 0.3); + space: srgb; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 -0.2 0.3)); + +<===> unitless/green/below_range/output.css +a { + value: color(srgb 0.1 -0.2 0.3); + space: srgb; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 1.3)); + +<===> unitless/blue/above_range/output.css +a { + value: color(srgb 0.1 0.2 1.3); + space: srgb; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 -0.3)); + +<===> unitless/blue/below_range/output.css +a { + value: color(srgb 0.1 0.2 -0.3); + space: srgb; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(srgb 0.1 0.2 0.3); + space: srgb; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 110% 0.2 0.3)); + +<===> percent/red/above_range/output.css +a { + value: color(srgb 1.1 0.2 0.3); + space: srgb; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb -10% 0.2 0.3)); + +<===> percent/red/below_range/output.css +a { + value: color(srgb -0.1 0.2 0.3); + space: srgb; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 120% 0.3)); + +<===> percent/green/above_range/output.css +a { + value: color(srgb 0.1 1.2 0.3); + space: srgb; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 -20% 0.3)); + +<===> percent/green/below_range/output.css +a { + value: color(srgb 0.1 -0.2 0.3); + space: srgb; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 130%)); + +<===> percent/blue/above_range/output.css +a { + value: color(srgb 0.1 0.2 1.3); + space: srgb; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 -30%)); + +<===> percent/blue/below_range/output.css +a { + value: color(srgb 0.1 0.2 -0.3); + space: srgb; + channels: 0.1 0.2 -0.3 / 1; +} diff --git a/spec/core_functions/color/color/spaces/srgb_linear.hrx b/spec/core_functions/color/color/spaces/srgb_linear.hrx new file mode 100644 index 0000000000..395abf17b8 --- /dev/null +++ b/spec/core_functions/color/color/spaces/srgb_linear.hrx @@ -0,0 +1,179 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(srgb-linear 0.1 0.2 0.3); + space: srgb-linear; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 1.1 0.2 0.3)); + +<===> unitless/red/above_range/output.css +a { + value: color(srgb-linear 1.1 0.2 0.3); + space: srgb-linear; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear -0.1 0.2 0.3)); + +<===> unitless/red/below_range/output.css +a { + value: color(srgb-linear -0.1 0.2 0.3); + space: srgb-linear; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 1.2 0.3)); + +<===> unitless/green/above_range/output.css +a { + value: color(srgb-linear 0.1 1.2 0.3); + space: srgb-linear; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 -0.2 0.3)); + +<===> unitless/green/below_range/output.css +a { + value: color(srgb-linear 0.1 -0.2 0.3); + space: srgb-linear; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 0.2 1.3)); + +<===> unitless/blue/above_range/output.css +a { + value: color(srgb-linear 0.1 0.2 1.3); + space: srgb-linear; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 0.2 -0.3)); + +<===> unitless/blue/below_range/output.css +a { + value: color(srgb-linear 0.1 0.2 -0.3); + space: srgb-linear; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(srgb-linear 0.1 0.2 0.3); + space: srgb-linear; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 110% 0.2 0.3)); + +<===> percent/red/above_range/output.css +a { + value: color(srgb-linear 1.1 0.2 0.3); + space: srgb-linear; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/red/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear -10% 0.2 0.3)); + +<===> percent/red/below_range/output.css +a { + value: color(srgb-linear -0.1 0.2 0.3); + space: srgb-linear; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 120% 0.3)); + +<===> percent/green/above_range/output.css +a { + value: color(srgb-linear 0.1 1.2 0.3); + space: srgb-linear; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/green/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 -20% 0.3)); + +<===> percent/green/below_range/output.css +a { + value: color(srgb-linear 0.1 -0.2 0.3); + space: srgb-linear; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 0.2 130%)); + +<===> percent/blue/above_range/output.css +a { + value: color(srgb-linear 0.1 0.2 1.3); + space: srgb-linear; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/blue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb-linear 0.1 0.2 -30%)); + +<===> percent/blue/below_range/output.css +a { + value: color(srgb-linear 0.1 0.2 -0.3); + space: srgb-linear; + channels: 0.1 0.2 -0.3 / 1; +} diff --git a/spec/core_functions/color/color/spaces/xyz.hrx b/spec/core_functions/color/color/spaces/xyz.hrx new file mode 100644 index 0000000000..9dfe04af2b --- /dev/null +++ b/spec/core_functions/color/color/spaces/xyz.hrx @@ -0,0 +1,192 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(xyz 0.1 0.2 0.3); + space: xyz; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/x/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 1.1 0.2 0.3)); + +<===> unitless/x/above_range/output.css +a { + value: color(xyz 1.1 0.2 0.3); + space: xyz; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/x/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz -0.1 0.2 0.3)); + +<===> unitless/x/below_range/output.css +a { + value: color(xyz -0.1 0.2 0.3); + space: xyz; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/y/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 1.2 0.3)); + +<===> unitless/y/above_range/output.css +a { + value: color(xyz 0.1 1.2 0.3); + space: xyz; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/y/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 -0.2 0.3)); + +<===> unitless/y/below_range/output.css +a { + value: color(xyz 0.1 -0.2 0.3); + space: xyz; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/z/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 0.2 1.3)); + +<===> unitless/z/above_range/output.css +a { + value: color(xyz 0.1 0.2 1.3); + space: xyz; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/z/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 0.2 -0.3)); + +<===> unitless/z/below_range/output.css +a { + value: color(xyz 0.1 0.2 -0.3); + space: xyz; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(xyz 0.1 0.2 0.3); + space: xyz; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/x/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 110% 0.2 0.3)); + +<===> percent/x/above_range/output.css +a { + value: color(xyz 1.1 0.2 0.3); + space: xyz; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/x/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz -10% 0.2 0.3)); + +<===> percent/x/below_range/output.css +a { + value: color(xyz -0.1 0.2 0.3); + space: xyz; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/y/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 120% 0.3)); + +<===> percent/y/above_range/output.css +a { + value: color(xyz 0.1 1.2 0.3); + space: xyz; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/y/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 -20% 0.3)); + +<===> percent/y/below_range/output.css +a { + value: color(xyz 0.1 -0.2 0.3); + space: xyz; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/z/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 0.2 130%)); + +<===> percent/z/above_range/output.css +a { + value: color(xyz 0.1 0.2 1.3); + space: xyz; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/z/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz 0.1 0.2 -30%)); + +<===> percent/z/below_range/output.css +a { + value: color(xyz 0.1 0.2 -0.3); + space: xyz; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> xyz_d65/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d65 0.1 0.2 0.3)); + +<===> xyz_d65/output.css +a { + value: color(xyz 0.1 0.2 0.3); + space: xyz; + channels: 0.1 0.2 0.3 / 1; +} diff --git a/spec/core_functions/color/color/spaces/xyz_d50.hrx b/spec/core_functions/color/color/spaces/xyz_d50.hrx new file mode 100644 index 0000000000..3357106e0e --- /dev/null +++ b/spec/core_functions/color/color/spaces/xyz_d50.hrx @@ -0,0 +1,179 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 0.2 0.3)); + +<===> unitless/in_range/output.css +a { + value: color(xyz-d50 0.1 0.2 0.3); + space: xyz-d50; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/x/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 1.1 0.2 0.3)); + +<===> unitless/x/above_range/output.css +a { + value: color(xyz-d50 1.1 0.2 0.3); + space: xyz-d50; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/x/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 -0.1 0.2 0.3)); + +<===> unitless/x/below_range/output.css +a { + value: color(xyz-d50 -0.1 0.2 0.3); + space: xyz-d50; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/y/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 1.2 0.3)); + +<===> unitless/y/above_range/output.css +a { + value: color(xyz-d50 0.1 1.2 0.3); + space: xyz-d50; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/y/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 -0.2 0.3)); + +<===> unitless/y/below_range/output.css +a { + value: color(xyz-d50 0.1 -0.2 0.3); + space: xyz-d50; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> unitless/z/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 0.2 1.3)); + +<===> unitless/z/above_range/output.css +a { + value: color(xyz-d50 0.1 0.2 1.3); + space: xyz-d50; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> unitless/z/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 0.2 -0.3)); + +<===> unitless/z/below_range/output.css +a { + value: color(xyz-d50 0.1 0.2 -0.3); + space: xyz-d50; + channels: 0.1 0.2 -0.3 / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 10% 20% 30%)); + +<===> percent/in_range/output.css +a { + value: color(xyz-d50 0.1 0.2 0.3); + space: xyz-d50; + channels: 0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/x/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 110% 0.2 0.3)); + +<===> percent/x/above_range/output.css +a { + value: color(xyz-d50 1.1 0.2 0.3); + space: xyz-d50; + channels: 1.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/x/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 -10% 0.2 0.3)); + +<===> percent/x/below_range/output.css +a { + value: color(xyz-d50 -0.1 0.2 0.3); + space: xyz-d50; + channels: -0.1 0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/y/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 120% 0.3)); + +<===> percent/y/above_range/output.css +a { + value: color(xyz-d50 0.1 1.2 0.3); + space: xyz-d50; + channels: 0.1 1.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/y/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 -20% 0.3)); + +<===> percent/y/below_range/output.css +a { + value: color(xyz-d50 0.1 -0.2 0.3); + space: xyz-d50; + channels: 0.1 -0.2 0.3 / 1; +} + +<===> +================================================================================ +<===> percent/z/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 0.2 130%)); + +<===> percent/z/above_range/output.css +a { + value: color(xyz-d50 0.1 0.2 1.3); + space: xyz-d50; + channels: 0.1 0.2 1.3 / 1; +} + +<===> +================================================================================ +<===> percent/z/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(xyz-d50 0.1 0.2 -30%)); + +<===> percent/z/below_range/output.css +a { + value: color(xyz-d50 0.1 0.2 -0.3); + space: xyz-d50; + channels: 0.1 0.2 -0.3 / 1; +} diff --git a/spec/core_functions/color/color/special_functions.hrx b/spec/core_functions/color/color/special_functions.hrx new file mode 100644 index 0000000000..064c758ba8 --- /dev/null +++ b/spec/core_functions/color/color/special_functions.hrx @@ -0,0 +1,142 @@ +<===> calculation/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb calc(1px + 1%) 0.2 0.3)); + +<===> calculation/arg_1/output.css +a { + value: color(srgb calc(1px + 1%) 0.2 0.3); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 calc(1px + 1%) 0.3)); + +<===> calculation/arg_2/output.css +a { + value: color(srgb 0.1 calc(1px + 1%) 0.3); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 calc(1px + 1%))); + +<===> calculation/arg_3/output.css +a { + value: color(srgb 0.1 0.2 calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3 / calc(1px + 1%))); + +<===> calculation/arg_4/output.css +a { + value: color(srgb 0.1 0.2 0.3/calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb var(--foo) 0.2 0.3)); + +<===> var/arg_1/output.css +a { + value: color(srgb var(--foo) 0.2 0.3); + type: string; +} + +<===> +================================================================================ +<===> var/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 var(--foo) 0.3)); + +<===> var/arg_2/output.css +a { + value: color(srgb 0.1 var(--foo) 0.3); + type: string; +} + +<===> +================================================================================ +<===> var/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 var(--foo))); + +<===> var/arg_3/output.css +a { + value: color(srgb 0.1 0.2 var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 0.2 0.3 / var(--foo))); + +<===> var/arg_4/output.css +a { + value: color(srgb 0.1 0.2 0.3/var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_2/input.scss +// var() is substituted before parsing, so it may contain multiple arguments. +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb var(--foo) 0.3)); + +<===> multi_argument_var/1_of_2/output.css +a { + value: color(srgb var(--foo) 0.3); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/2_of_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb 0.1 var(--foo))); + +<===> multi_argument_var/2_of_2/output.css +a { + value: color(srgb 0.1 var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/no_alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb var(--foo))); + +<===> multi_argument_var/1_of_1/no_alpha/output.css +a { + value: color(srgb var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(color(srgb var(--foo) / 0.4)); + +<===> multi_argument_var/1_of_1/alpha/output.css +a { + value: color(srgb var(--foo)/0.4); + type: string; +} diff --git a/spec/core_functions/color/complement.hrx b/spec/core_functions/color/complement.hrx index fc94247e52..fff9ba9d24 100644 --- a/spec/core_functions/color/complement.hrx +++ b/spec/core_functions/color/complement.hrx @@ -62,11 +62,153 @@ a { b: rgba(224, 64, 80, 0.7); } +<===> +================================================================================ +<===> explicit_space/input.scss +a {b: complement(red, hwb)} + +<===> explicit_space/output.css +a { + b: aqua; +} + +<===> +================================================================================ +<===> space/legacy/to_legacy/input.scss +@use "sass:color"; +a {b: color.complement(red, $space: hwb)} + +<===> space/legacy/to_legacy/output.css +a { + b: aqua; +} + +<===> +================================================================================ +<===> space/legacy/to_modern/input.scss +@use "sass:color"; +a {b: color.complement(red, $space: oklch)} + +<===> space/legacy/to_modern/output.css +a { + b: hsl(188.1998868883, 488.1808399597%, 14.588696385%); +} + +<===> +================================================================================ +<===> space/modern/to_legacy/input.scss +@use "sass:color"; +a {b: color.complement(lab(50% 10 -20), $space: hsl)} + +<===> space/modern/to_legacy/output.css +a { + b: lab(61.7521821385% -8.5219772697 19.4842183485); +} + +<===> +================================================================================ +<===> space/modern/to_modern/input.scss +@use "sass:color"; +a {b: color.complement(lab(50% 10 -20), $space: oklch)} + +<===> space/modern/to_modern/output.css +a { + b: lab(51.2269614349% -7.7080887555 21.8652618775); +} + +<===> +================================================================================ +<===> space/missing/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.complement(hsl(0deg 50% none))} + +<===> space/missing/legacy/same/implicit/output.css +a { + b: hsl(180deg 50% none); +} + +<===> +================================================================================ +<===> space/missing/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.complement(hsl(0deg 50% none), $space: hsl)} + +<===> space/missing/legacy/same/explicit/output.css +a { + b: hsl(180deg 50% none); +} + +<===> +================================================================================ +<===> space/missing/legacy/different/implicit/input.scss +@use "sass:color"; +a {b: color.complement(hwb(0deg 50% none))} + +<===> space/missing/legacy/different/implicit/output.css +a { + b: hsl(180, 100%, 75%); +} + +<===> +================================================================================ +<===> space/missing/legacy/different/explicit/input.scss +@use "sass:color"; +a {b: color.complement(hwb(0deg 50% none), $space: hsl)} + +<===> space/missing/legacy/different/explicit/output.css +a { + b: hsl(180, 100%, 75%); +} + +<===> +================================================================================ +<===> space/missing/modern/same/input.scss +@use "sass:color"; +a {b: color.complement(lch(none 50% 0deg), $space: hsl)} + +<===> space/missing/modern/same/output.css +a { + b: lch(none 0 none); +} + +<===> +================================================================================ +<===> space/missing/modern/different/input.scss +@use "sass:color"; +a {b: color.complement(color(srgb none 100 200), $space: oklch)} + +<===> space/missing/modern/different/output.css +a { + b: color(srgb 156.4212689375 85.1578644836 -71.2263945029); +} + +<===> +================================================================================ +<===> space/missing/modern/analogous/input.scss +@use "sass:color"; +a {b: color.complement(lch(none 50% 0deg), $space: oklch)} + +<===> space/missing/modern/analogous/output.css +a { + b: lch(none 24.5072211405 180.9107983689deg); +} + +<===> +================================================================================ +<===> space/powerless/legacy/implicit/input.scss +@use "sass:color"; +a {b: color.complement(hsl(0deg 0% 50%))} + +<===> space/powerless/legacy/implicit/output.css +a { + b: hsl(180, 0%, 50%); +} + <===> ================================================================================ <===> named/input.scss @use "sass:color"; -a {b: color.complement($color: red)} +a {b: color.complement($color: red, $space: hwb)} <===> named/output.css a { @@ -86,8 +228,8 @@ Error: Missing argument $color. | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color -1 | @function complement($color) { - | ================== declaration +1 | @function complement($color, $space: null) { + | ================================ declaration ' input.scss 2:7 root stylesheet @@ -95,17 +237,17 @@ Error: Missing argument $color. ================================================================================ <===> error/too_many_args/input.scss @use "sass:color"; -a {b: color.complement(red, 1)} +a {b: color.complement(red, lch, 1)} <===> error/too_many_args/error -Error: Only 1 argument allowed, but 2 were passed. +Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -2 | a {b: color.complement(red, 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.complement(red, lch, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color -1 | @function complement($color) { - | ================== declaration +1 | @function complement($color, $space: null) { + | ================================ declaration ' input.scss 2:7 root stylesheet @@ -122,3 +264,145 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/null_space/non_legacy/input.scss +@use "sass:color"; +a {b: color.complement(oklch(0.63 0.26 29.2))} + +<===> error/null_space/non_legacy/error +Error: $space: null is not a string. + , +2 | a {b: color.complement(oklch(0.63 0.26 29.2))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/non_polar_angle/input.scss +@use "sass:color"; +a {b: color.complement(red, xyz)} + +<===> error/space/non_polar_angle/error +Error: $space: Color space xyz doesn't have a hue channel. + , +2 | a {b: color.complement(red, xyz)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/missing/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.complement(hsl(none 30% 40%))} + +<===> error/space/missing/legacy/same/implicit/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hsl(none 30% 40%)). + , +2 | a {b: color.complement(hsl(none 30% 40%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/missing/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.complement(hsl(none 30% 40%), $space: hsl)} + +<===> error/space/missing/legacy/same/explicit/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hsl(none 30% 40%)). + , +2 | a {b: color.complement(hsl(none 30% 40%), $space: hsl)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/missing/legacy/analogous/hue/input.scss +@use "sass:color"; +a {b: color.complement(hsl(none 30% 40%), $space: lch)} + +<===> error/space/missing/legacy/analogous/hue/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lch(38.0910184332% 29.3078189694 none)). + , +2 | a {b: color.complement(hsl(none 30% 40%), $space: lch)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/missing/legacy/analogous/lightness/input.scss +// This is an error specifically because hsl(0deg 50% none) converts through +// rgb(0 0 0) to lch(none 0 none), so adjusting the hue fails. +@use "sass:color"; +a {b: color.complement(hsl(0deg 50% none), $space: lch)} + +<===> error/space/missing/legacy/analogous/lightness/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lch(none 0 none)). + , +4 | a {b: color.complement(hsl(0deg 50% none), $space: lch)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 4:7 root stylesheet + +<===> +================================================================================ +<===> error/space/missing/modern/same/input.scss +@use "sass:color"; +a {b: color.complement(lch(40% 30% none), $space: hsl)} + +<===> error/space/missing/modern/same/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hsl(none 46.6772108151% 42.1546574074%)). + , +2 | a {b: color.complement(lch(40% 30% none), $space: hsl)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/missing/modern/analogous/input.scss +@use "sass:color"; +a {b: color.complement(lch(40% 30% none), $space: lch)} + +<===> error/space/missing/modern/analogous/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lch(40% 45 none)). + , +2 | a {b: color.complement(lch(40% 30% none), $space: lch)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/powerless/legacy/explicit/input.scss +@use "sass:color"; +a {b: color.complement(grey, $space: hsl)} + +<===> error/space/powerless/legacy/explicit/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hsl(none 0% 50.1960784314%)). + , +2 | a {b: color.complement(grey, $space: hsl)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space/powerless/modern/input.scss +@use "sass:color"; +a {b: color.complement(lab(50% 0 0), $space: lch)} + +<===> error/space/powerless/modern/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lch(50% 0 none)). + , +2 | a {b: color.complement(lab(50% 0 0), $space: lch)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/darken.hrx b/spec/core_functions/color/darken.hrx new file mode 100644 index 0000000000..569cf90dbc --- /dev/null +++ b/spec/core_functions/color/darken.hrx @@ -0,0 +1,263 @@ +<===> max/input.scss +a {b: darken(red, 100%)} + +<===> max/output.css +a { + b: black; +} + +<===> max/warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -100%) +color.adjust($color, $lightness: -100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken(red, 100%)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> max_remaining/input.scss +a {b: darken(red, 50%)} + +<===> max_remaining/output.css +a { + b: black; +} + +<===> max_remaining/warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -100%) +color.adjust($color, $lightness: -50%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken(red, 50%)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> min/input.scss +a {b: darken(red, 0%)} + +<===> min/output.css +a { + b: red; +} + +<===> min/warning +DEPRECATION WARNING: darken() is deprecated. Suggestion: + +color.adjust($color, $lightness: 0%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken(red, 0%)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> middle/input.scss +a {b: darken(red, 14%)} + +<===> middle/output.css +a { + b: rgb(183.6, 0, 0); +} + +<===> middle/warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -28%) +color.adjust($color, $lightness: -14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken(red, 14%)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> fraction/input.scss +a {b: darken(red, 0.5%)} + +<===> fraction/output.css +a { + b: rgb(252.45, 0, 0); +} + +<===> fraction/warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -1%) +color.adjust($color, $lightness: -0.5%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken(red, 0.5%)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/input.scss +a {b: darken(rgba(red, 0.2), 100%)} + +<===> alpha/output.css +a { + b: rgba(0, 0, 0, 0.2); +} + +<===> alpha/warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -100%) +color.adjust($color, $lightness: -100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken(rgba(red, 0.2), 100%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +a {b: darken($color: red, $amount: 14%)} + +<===> named/output.css +a { + b: rgb(183.6, 0, 0); +} + +<===> named/warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -28%) +color.adjust($color, $lightness: -14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken($color: red, $amount: 14%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_few_args/input.scss +a {b: darken(red)} + +<===> error/too_few_args/error +Error: Missing argument $amount. + ,--> input.scss +1 | a {b: darken(red)} + | ^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function darken($color, $amount) { + | ======================= declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: darken(red, 1%, 2)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +1 | a {b: darken(red, 1%, 2)} + | ^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function darken($color, $amount) { + | ======================= declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color/input.scss +a {b: darken(1, 2)} + +<===> error/type/color/error +Error: $color: 1 is not a color. + , +1 | a {b: darken(1, 2)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/lightness/input.scss +a {b: darken(red, blue)} + +<===> error/type/lightness/error +Error: $amount: blue is not a number. + , +1 | a {b: darken(red, blue)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_low/input.scss +a {b: darken(red, -0.001)} + +<===> error/bounds/too_low/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: darken(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_high/input.scss +a {b: darken(red, 100.001)} + +<===> error/bounds/too_high/error +Error: $amount: Expected 100.001 to be within 0 and 100. + , +1 | a {b: darken(red, 100.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +a {b: darken(color(srgb 1 1 1), 10%)} + +<===> error/non_legacy/error +Error: darken() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument. + , +1 | a {b: darken(color(srgb 1 1 1), 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/desaturate.hrx b/spec/core_functions/color/desaturate.hrx new file mode 100644 index 0000000000..08a0fa1d18 --- /dev/null +++ b/spec/core_functions/color/desaturate.hrx @@ -0,0 +1,256 @@ +<===> max/input.scss +a {b: desaturate(plum, 100%)} + +<===> max/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> max/warning +DEPRECATION WARNING: desaturate() is deprecated. Suggestions: + +color.scale($color, $saturation: -100%) +color.adjust($color, $saturation: -100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: desaturate(plum, 100%)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> max_remaining/input.scss +a {b: desaturate(plum, 48%)} + +<===> max_remaining/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> max_remaining/warning +DEPRECATION WARNING: desaturate() is deprecated. Suggestions: + +color.scale($color, $saturation: -100%) +color.adjust($color, $saturation: -48%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: desaturate(plum, 48%)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> min/input.scss +a {b: desaturate(plum, 0%)} + +<===> min/output.css +a { + b: plum; +} + +<===> min/warning +DEPRECATION WARNING: desaturate() is deprecated. Suggestion: + +color.adjust($color, $saturation: 0%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: desaturate(plum, 0%)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> middle/input.scss +a {b: desaturate(plum, 14%)} + +<===> middle/output.css +a { + b: rgb(211.97, 169.03, 211.97); +} + +<===> middle/warning +DEPRECATION WARNING: desaturate() is deprecated. Suggestions: + +color.scale($color, $saturation: -29.606557377%) +color.adjust($color, $saturation: -14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: desaturate(plum, 14%)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/input.scss +a {b: desaturate(rgba(plum, 0.3), 100%)} + +<===> alpha/output.css +a { + b: rgba(190.5, 190.5, 190.5, 0.3); +} + +<===> alpha/warning +DEPRECATION WARNING: desaturate() is deprecated. Suggestions: + +color.scale($color, $saturation: -100%) +color.adjust($color, $saturation: -100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: desaturate(rgba(plum, 0.3), 100%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +a {b: desaturate($color: plum, $amount: 14%)} + +<===> named/output.css +a { + b: rgb(211.97, 169.03, 211.97); +} + +<===> named/warning +DEPRECATION WARNING: desaturate() is deprecated. Suggestions: + +color.scale($color, $saturation: -29.606557377%) +color.adjust($color, $saturation: -14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: desaturate($color: plum, $amount: 14%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_few_args/input.scss +a {b: desaturate(plum)} + +<===> error/too_few_args/error +Error: Missing argument $amount. + ,--> input.scss +1 | a {b: desaturate(plum)} + | ^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function desaturate($color, $amount) { + | =========================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: desaturate(plum, 1%, 2)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +1 | a {b: desaturate(plum, 1%, 2)} + | ^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function desaturate($color, $amount) { + | =========================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/one_arg/type/input.scss +a {b: desaturate(red)} + +<===> error/one_arg/type/error +Error: Missing argument $amount. + ,--> input.scss +1 | a {b: desaturate(red)} + | ^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function desaturate($color, $amount) { + | =========================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color/input.scss +a {b: desaturate(1, 2)} + +<===> error/type/color/error +Error: $color: 1 is not a color. + , +1 | a {b: desaturate(1, 2)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/lightness/input.scss +a {b: desaturate(plum, blue)} + +<===> error/type/lightness/error +Error: $amount: blue is not a number. + , +1 | a {b: desaturate(plum, blue)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_low/input.scss +a {b: desaturate(plum, -0.001)} + +<===> error/bounds/too_low/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: desaturate(plum, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_high/input.scss +a {b: desaturate(plum, 100.001)} + +<===> error/bounds/too_high/error +Error: $amount: Expected 100.001 to be within 0 and 100. + , +1 | a {b: desaturate(plum, 100.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +a {b: desaturate(color(srgb 1 1 1), 10%)} + +<===> error/non_legacy/error +Error: desaturate() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument. + , +1 | a {b: desaturate(color(srgb 1 1 1), 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/fade_in.hrx b/spec/core_functions/color/fade_in.hrx new file mode 100644 index 0000000000..b99cf5af47 --- /dev/null +++ b/spec/core_functions/color/fade_in.hrx @@ -0,0 +1,254 @@ +<===> max/input.scss +a {b: fade-in(rgba(red, 0.5), 1)} + +<===> max/output.css +a { + b: red; +} + +<===> max/warning +DEPRECATION WARNING: fade-in() is deprecated. Suggestions: + +color.scale($color, $alpha: 100%) +color.adjust($color, $alpha: 1) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-in(rgba(red, 0.5), 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> max_remaining/input.scss +a {b: fade-in(rgba(red, 0.5), 0.5)} + +<===> max_remaining/output.css +a { + b: red; +} + +<===> max_remaining/warning +DEPRECATION WARNING: fade-in() is deprecated. Suggestions: + +color.scale($color, $alpha: 100%) +color.adjust($color, $alpha: 0.5) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-in(rgba(red, 0.5), 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> min/input.scss +a {b: fade-in(rgba(red, 0.5), 0)} + +<===> min/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> min/warning +DEPRECATION WARNING: fade-in() is deprecated. Suggestion: + +color.adjust($color, $alpha: 0) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-in(rgba(red, 0.5), 0)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> middle/input.scss +a {b: fade-in(rgba(red, 0.5), 0.14)} + +<===> middle/output.css +a { + b: rgba(255, 0, 0, 0.64); +} + +<===> middle/warning +DEPRECATION WARNING: fade-in() is deprecated. Suggestions: + +color.scale($color, $alpha: 28%) +color.adjust($color, $alpha: 0.14) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-in(rgba(red, 0.5), 0.14)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +a {b: fade-in($color: rgba(red, 0.5), $amount: 0.14)} + +<===> named/output.css +a { + b: rgba(255, 0, 0, 0.64); +} + +<===> named/warning +DEPRECATION WARNING: fade-in() is deprecated. Suggestions: + +color.scale($color, $alpha: 28%) +color.adjust($color, $alpha: 0.14) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-in($color: rgba(red, 0.5), $amount: 0.14)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> opacify/input.scss +a {b: opacify($color: rgba(red, 0.5), $amount: 0.14)} + +<===> opacify/output.css +a { + b: rgba(255, 0, 0, 0.64); +} + +<===> opacify/warning +DEPRECATION WARNING: opacify() is deprecated. Suggestions: + +color.scale($color, $alpha: 28%) +color.adjust($color, $alpha: 0.14) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: opacify($color: rgba(red, 0.5), $amount: 0.14)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_few_args/input.scss +a {b: fade-in(red)} + +<===> error/too_few_args/error +Error: Missing argument $amount. + ,--> input.scss +1 | a {b: fade-in(red)} + | ^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function fade-in($color, $amount) { + | ======================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: fade-in(red, 0.1, 2)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +1 | a {b: fade-in(red, 0.1, 2)} + | ^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function fade-in($color, $amount) { + | ======================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color/input.scss +a {b: fade-in(1, 0.1)} + +<===> error/type/color/error +Error: $color: 1 is not a color. + , +1 | a {b: fade-in(1, 0.1)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/alpha/input.scss +a {b: fade-in(red, blue)} + +<===> error/type/alpha/error +Error: $amount: blue is not a number. + , +1 | a {b: fade-in(red, blue)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_low/input.scss +a {b: fade-in(red, -0.001)} + +<===> error/bounds/too_low/error +Error: $amount: Expected -0.001 to be within 0 and 1. + , +1 | a {b: fade-in(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_high/input.scss +a {b: fade-in(red, 1.001)} + +<===> error/bounds/too_high/error +Error: $amount: Expected 1.001 to be within 0 and 1. + , +1 | a {b: fade-in(red, 1.001)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/unit/input.scss +// This test covers sass/dart-sass#1745, but should be removed once units are +// fully forbidden (sass/sass#3374). +a {b: fade-in(red, 50%)} + +<===> error/bounds/unit/error +Error: $amount: Expected 50% to be within 0 and 1. + , +3 | a {b: fade-in(red, 50%)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +a {b: fade-in(color(srgb 1 1 1 / 0.1), 0.1)} + +<===> error/non_legacy/error +Error: fade-in() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument. + , +1 | a {b: fade-in(color(srgb 1 1 1 / 0.1), 0.1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/fade_out.hrx b/spec/core_functions/color/fade_out.hrx new file mode 100644 index 0000000000..146ee8d427 --- /dev/null +++ b/spec/core_functions/color/fade_out.hrx @@ -0,0 +1,254 @@ +<===> max/input.scss +a {b: fade-out(rgba(red, 0.5), 1)} + +<===> max/output.css +a { + b: rgba(255, 0, 0, 0); +} + +<===> max/warning +DEPRECATION WARNING: fade-out() is deprecated. Suggestions: + +color.scale($color, $alpha: -100%) +color.adjust($color, $alpha: -1) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-out(rgba(red, 0.5), 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> max_remaining/input.scss +a {b: fade-out(rgba(red, 0.5), 0.5)} + +<===> max_remaining/output.css +a { + b: rgba(255, 0, 0, 0); +} + +<===> max_remaining/warning +DEPRECATION WARNING: fade-out() is deprecated. Suggestions: + +color.scale($color, $alpha: -100%) +color.adjust($color, $alpha: -0.5) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-out(rgba(red, 0.5), 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> min/input.scss +a {b: fade-out(rgba(red, 0.5), 0)} + +<===> min/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> min/warning +DEPRECATION WARNING: fade-out() is deprecated. Suggestion: + +color.adjust($color, $alpha: 0) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-out(rgba(red, 0.5), 0)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> middle/input.scss +a {b: fade-out(rgba(red, 0.5), 0.14)} + +<===> middle/output.css +a { + b: rgba(255, 0, 0, 0.36); +} + +<===> middle/warning +DEPRECATION WARNING: fade-out() is deprecated. Suggestions: + +color.scale($color, $alpha: -28%) +color.adjust($color, $alpha: -0.14) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-out(rgba(red, 0.5), 0.14)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +a {b: fade-out($color: rgba(red, 0.5), $amount: 0.14)} + +<===> named/output.css +a { + b: rgba(255, 0, 0, 0.36); +} + +<===> named/warning +DEPRECATION WARNING: fade-out() is deprecated. Suggestions: + +color.scale($color, $alpha: -28%) +color.adjust($color, $alpha: -0.14) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-out($color: rgba(red, 0.5), $amount: 0.14)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> transparentize/input.scss +a {b: transparentize($color: rgba(red, 0.5), $amount: 0.14)} + +<===> transparentize/output.css +a { + b: rgba(255, 0, 0, 0.36); +} + +<===> transparentize/warning +DEPRECATION WARNING: transparentize() is deprecated. Suggestions: + +color.scale($color, $alpha: -28%) +color.adjust($color, $alpha: -0.14) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: transparentize($color: rgba(red, 0.5), $amount: 0.14)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_few_args/input.scss +a {b: fade-out(red)} + +<===> error/too_few_args/error +Error: Missing argument $amount. + ,--> input.scss +1 | a {b: fade-out(red)} + | ^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function fade-out($color, $amount) { + | ========================= declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: fade-out(red, 0.1, 2)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +1 | a {b: fade-out(red, 0.1, 2)} + | ^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function fade-out($color, $amount) { + | ========================= declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color/input.scss +a {b: fade-out(1, 0.1)} + +<===> error/type/color/error +Error: $color: 1 is not a color. + , +1 | a {b: fade-out(1, 0.1)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/alpha/input.scss +a {b: fade-out(red, blue)} + +<===> error/type/alpha/error +Error: $amount: blue is not a number. + , +1 | a {b: fade-out(red, blue)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_low/input.scss +a {b: fade-out(red, -0.001)} + +<===> error/bounds/too_low/error +Error: $amount: Expected -0.001 to be within 0 and 1. + , +1 | a {b: fade-out(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_high/input.scss +a {b: fade-out(red, 1.001)} + +<===> error/bounds/too_high/error +Error: $amount: Expected 1.001 to be within 0 and 1. + , +1 | a {b: fade-out(red, 1.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/unit/input.scss +// This test covers sass/dart-sass#1745, but should be removed once units are +// fully forbidden (sass/sass#3374). +a {b: fade-out(red, 50%)} + +<===> error/bounds/unit/error +Error: $amount: Expected 50% to be within 0 and 1. + , +3 | a {b: fade-out(red, 50%)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +a {b: fade-out(color(srgb 1 1 1), 0.1)} + +<===> error/non_legacy/error +Error: fade-out() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument. + , +1 | a {b: fade-out(color(srgb 1 1 1), 0.1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/grayscale.hrx b/spec/core_functions/color/grayscale.hrx index 1d44c8521f..68ce5c3466 100644 --- a/spec/core_functions/color/grayscale.hrx +++ b/spec/core_functions/color/grayscale.hrx @@ -1,90 +1,153 @@ -<===> no_saturation/white/input.scss +<===> legacy/no_saturation/white/input.scss @use "sass:color"; a {b: color.grayscale(white)} -<===> no_saturation/white/output.css +<===> legacy/no_saturation/white/output.css a { b: white; } <===> ================================================================================ -<===> no_saturation/black/input.scss +<===> legacy/no_saturation/black/input.scss @use "sass:color"; a {b: color.grayscale(black)} -<===> no_saturation/black/output.css +<===> legacy/no_saturation/black/output.css a { b: black; } <===> ================================================================================ -<===> no_saturation/gray/input.scss +<===> legacy/no_saturation/gray/input.scss @use "sass:color"; a {b: color.grayscale(#494949)} -<===> no_saturation/gray/output.css +<===> legacy/no_saturation/gray/output.css a { b: #494949; } <===> ================================================================================ -<===> max_saturation/input.scss +<===> legacy/max_saturation/input.scss @use "sass:color"; a {b: color.grayscale(red)} -<===> max_saturation/output.css +<===> legacy/max_saturation/output.css a { - b: gray; + b: rgb(127.5, 127.5, 127.5); } <===> ================================================================================ -<===> mid_saturation/input.scss +<===> legacy/mid_saturation/input.scss @use "sass:color"; a {b: color.grayscale(#633736)} -<===> mid_saturation/output.css +<===> legacy/mid_saturation/output.css a { - b: #4d4d4d; + b: rgb(76.5, 76.5, 76.5); } <===> ================================================================================ -<===> alpha/input.scss +<===> legacy/alpha/input.scss @use "sass:color"; a {b: color.grayscale(rgba(#633736, 0.3))} -<===> alpha/output.css +<===> legacy/alpha/output.css a { - b: rgba(77, 77, 77, 0.3); + b: rgba(76.5, 76.5, 76.5, 0.3); } <===> ================================================================================ -<===> named/input.scss +<===> legacy/powerless/same/input.scss @use "sass:color"; -a {b: color.grayscale($color: white)} +a {b: color.grayscale(hsl(120deg 10% 20%))} -<===> named/output.css +<===> legacy/powerless/same/output.css a { - b: white; + b: hsl(120, 0%, 20%); +} + +<===> +================================================================================ +<===> legacy/powerless/different/input.scss +@use "sass:color"; +a {b: color.grayscale(hwb(120deg 10% 20%))} + +<===> legacy/powerless/different/output.css +a { + b: hsl(0, 0%, 45%); } <===> ================================================================================ -<===> css_overload/input.scss +<===> legacy/missing/input.scss +@use "sass:color"; +a {b: color.grayscale(hsl(none none none))} + +<===> legacy/missing/output.css +a { + b: hsl(none 0% none); +} + +<===> +================================================================================ +<===> global/number/input.scss +// A number should produce a plain function string, for CSS filter functions. +a {b: grayscale(15%)} + +<===> global/number/output.css +a { + b: grayscale(15%); +} + +<===> +================================================================================ +<===> global/with_css_var/input.scss +a {b: grayscale(var(--c))} + +<===> global/with_css_var/output.css +a { + b: grayscale(var(--c)); +} + +<===> +================================================================================ +<===> global/with_calc/input.scss +a {b: grayscale(calc(1 + 2))} + +<===> global/with_calc/output.css +a { + b: grayscale(3); +} + +<===> +================================================================================ +<===> global/with_unquoted_calc/input.scss +a {b: grayscale(unquote('calc(1)'))} + +<===> global/with_unquoted_calc/output.css +a { + b: grayscale(calc(1)); +} + +<===> +================================================================================ +<===> number/input.scss @use "sass:color"; a {b: color.grayscale(1)} -<===> css_overload/output.css +<===> number/output.css a { b: grayscale(1); } -<===> css_overload/warning +<===> number/warning DEPRECATION WARNING: Passing a number (1) to color.grayscale() is deprecated. Recommendation: grayscale(1) @@ -95,6 +158,72 @@ Recommendation: grayscale(1) ' input.scss 2:7 root stylesheet +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.grayscale($color: white)} + +<===> named/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> modern/rectangular/input.scss +@use "sass:color"; +a {b: color.grayscale(lab(50 -30 40))} + +<===> modern/rectangular/output.css +a { + b: lab(48.58892555% 0.0000000648 -0.0000078984); +} + +<===> +================================================================================ +<===> modern/polar/input.scss +@use "sass:color"; +a {b: color.grayscale(lch(54.3 107 40.9))} + +<===> modern/polar/output.css +a { + b: lch(56.854581217% 0.0000089094 270.4699001175deg); +} + +<===> +================================================================================ +<===> modern/predefined/input.scss +@use "sass:color"; +a {b: color.grayscale(color(xyz-d65 0.41 0.21 0.02))} + +<===> modern/predefined/output.css +a { + b: color(xyz 0.232829773 0.2449664044 0.2667826176); +} + +<===> +================================================================================ +<===> modern/powerless/input.scss +@use "sass:color"; +a {b: color.grayscale(oklch(20% 10% 120deg))} + +<===> modern/powerless/output.css +a { + b: oklch(20% 0 120deg); +} + +<===> +================================================================================ +<===> modern/missing/input.scss +@use "sass:color"; +a {b: color.grayscale(oklch(none none none))} + +<===> modern/missing/output.css +a { + b: oklch(none 0 none); +} + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -147,11 +276,11 @@ Error: $color: c is not a color. <===> ================================================================================ -<===> error/css_variable/input.scss -@use 'sass:color'; +<===> error/with_module/type/input.scss +@use "sass:color"; a {b: color.grayscale(var(--c))} -<===> error/css_variable/error +<===> error/with_module/type/error Error: $color: var(--c) is not a color. , 2 | a {b: color.grayscale(var(--c))} diff --git a/spec/core_functions/color/green.hrx b/spec/core_functions/color/green.hrx index cc595429da..dd339fd5e4 100644 --- a/spec/core_functions/color/green.hrx +++ b/spec/core_functions/color/green.hrx @@ -7,6 +7,19 @@ a { b: 255; } +<===> max/warning +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.green(rgb(0, 255, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss @@ -18,6 +31,19 @@ a { b: 0; } +<===> min/warning +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.green(rgb(0, 0, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/input.scss @@ -29,6 +55,19 @@ a { b: 123; } +<===> middle/warning +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.green(rgb(0, 123, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss @@ -40,6 +79,19 @@ a { b: 234; } +<===> named/warning +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.green($color: rgb(0, 234, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -89,3 +141,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.green(color(srgb 1 1 1))} + +<===> error/non_legacy/error +Error: color.green() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.green(color(srgb 1 1 1))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/hsl/error/one_arg.hrx b/spec/core_functions/color/hsl/error/one_arg.hrx index c9f7ad8efd..f723f5a08c 100644 --- a/spec/core_functions/color/hsl/error/one_arg.hrx +++ b/spec/core_functions/color/hsl/error/one_arg.hrx @@ -4,7 +4,7 @@ a { } <===> list/empty/error -Error: Missing element $hue. +Error: $channels: Color component list may not be empty. , 2 | b: hsl(()); | ^^^^^^^ @@ -19,7 +19,7 @@ a { } <===> list/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space- or slash-separated list, was (0, 100%, 50%) , 2 | b: hsl((0, 100%, 50%)); | ^^^^^^^^^^^^^^^^^^^ @@ -34,7 +34,7 @@ a { } <===> list/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [0 100% 50%] , 2 | b: hsl([0 100% 50%]); | ^^^^^^^^^^^^^^^^^ @@ -49,7 +49,7 @@ a { } <===> list/one_element/error -Error: Missing element $saturation. +Error: $channels: The hsl color space has 3 channels but 0 has 1. , 2 | b: hsl(0); | ^^^^^^ @@ -64,7 +64,7 @@ a { } <===> list/two_elements/error -Error: Missing element $lightness. +Error: $channels: The hsl color space has 3 channels but (0 100%) has 2. , 2 | b: hsl(0 100%); | ^^^^^^^^^^^ @@ -79,7 +79,7 @@ a { } <===> list/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The hsl color space has 3 channels but (0 100% 50% 0.4) has 4. , 2 | b: hsl(0 100% 50% 0.4); | ^^^^^^^^^^^^^^^^^^^ @@ -94,7 +94,7 @@ a { } <===> type/hue/error -Error: $hue: "foo" is not a number. +Error: $channels: Expected hue channel to be a number, was "foo". , 2 | b: hsl("foo" 100% 50%); | ^^^^^^^^^^^^^^^^^^^ @@ -109,7 +109,7 @@ a { } <===> type/saturation/error -Error: $saturation: "foo" is not a number. +Error: $channels: Expected saturation channel to be a number, was "foo". , 2 | b: hsl(0 "foo" 50%); | ^^^^^^^^^^^^^^^^ @@ -124,7 +124,7 @@ a { } <===> type/lightness/error -Error: $lightness: "foo" is not a number. +Error: $channels: Expected lightness channel to be a number, was "foo". , 2 | b: hsl(0 100% "foo"); | ^^^^^^^^^^^^^^^^^ @@ -139,7 +139,7 @@ a { } <===> quoted_var_slash/error -Error: $lightness: "var(--foo) / 0.4" is not a number. +Error: $channels: Expected lightness channel to be a number, was "var(--foo) / 0.4". , 2 | b: hsl(0 100% "var(--foo) / 0.4"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -153,7 +153,7 @@ Error: $lightness: "var(--foo) / 0.4" is not a number. a {b: hsl(list.append((), 0 100% 100%, $separator: slash))} <===> slash_list/too_few_elements/error -Error: Only 2 slash-separated elements allowed, but 1 was passed. +Error: $channels: Only 2 slash-separated elements allowed, but 1 was passed. , 2 | a {b: hsl(list.append((), 0 100% 100%, $separator: slash))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -167,7 +167,7 @@ Error: Only 2 slash-separated elements allowed, but 1 was passed. a {b: hsl(list.slash(0 100% 100%, 0.4, 1))} <===> slash_list/too_many_elements/error -Error: Only 2 slash-separated elements allowed, but 3 were passed. +Error: $channels: Only 2 slash-separated elements allowed, but 3 were passed. , 2 | a {b: hsl(list.slash(0 100% 100%, 0.4, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -181,7 +181,7 @@ Error: Only 2 slash-separated elements allowed, but 3 were passed. a {b: hsl(list.slash((), 1))} <===> slash_list/channels/empty/error -Error: Missing element $hue. +Error: $channels: Color component list may not be empty. , 2 | a {b: hsl(list.slash((), 1))} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -195,7 +195,7 @@ Error: Missing element $hue. a {b: hsl(list.slash((0, 100%, 50%), 1))} <===> slash_list/channels/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space-separated list, was (0, 100%, 50%) , 2 | a {b: hsl(list.slash((0, 100%, 50%), 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -209,7 +209,7 @@ Error: $channels must be a space-separated list. a {b: hsl(list.slash([0 100% 50%], 1))} <===> slash_list/channels/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [0 100% 50%] , 2 | a {b: hsl(list.slash([0 100% 50%], 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -223,7 +223,7 @@ Error: $channels must be an unbracketed list. a {b: hsl(list.slash(0, 1))} <===> slash_list/channels/one_element/error -Error: Missing element $saturation. +Error: $channels: The hsl color space has 3 channels but (0 / 1) has 1. , 2 | a {b: hsl(list.slash(0, 1))} | ^^^^^^^^^^^^^^^^^^^^^ @@ -237,7 +237,7 @@ Error: Missing element $saturation. a {b: hsl(list.slash(0 100%, 1))} <===> slash_list/channels/two_elements/error -Error: Missing element $lightness. +Error: $channels: The hsl color space has 3 channels but (0 100% / 1) has 2. , 2 | a {b: hsl(list.slash(0 100%, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -251,7 +251,7 @@ Error: Missing element $lightness. a {b: hsl(list.slash(0 100% 50% 0.4, 1))} <===> slash_list/channels/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The hsl color space has 3 channels but (0 100% 50% 0.4 / 1) has 4. , 2 | a {b: hsl(list.slash(0 100% 50% 0.4, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hsl/four_args/clamped.hrx b/spec/core_functions/color/hsl/four_args/clamped.hrx deleted file mode 100644 index c4aa155fa9..0000000000 --- a/spec/core_functions/color/hsl/four_args/clamped.hrx +++ /dev/null @@ -1,42 +0,0 @@ -<===> README.md -Channels that are out of bounds are clamped within bounds. - -<===> -================================================================================ -<===> saturation/input.scss -a {b: hsl(0, -0.1%, 50%, 0.5)} - -<===> saturation/output.css -a { - b: hsla(0, 0%, 50%, 0.5); -} - -<===> -================================================================================ -<===> blue/input.scss -a {b: hsl(0, 100%, 9999%, 0.5)} - -<===> blue/output.css -a { - b: hsla(0, 100%, 100%, 0.5); -} - -<===> -================================================================================ -<===> alpha/above/input.scss -a {b: hsl(0, 100%, 50%, 1.1)} - -<===> alpha/above/output.css -a { - b: hsl(0, 100%, 50%); -} - -<===> -================================================================================ -<===> alpha/below/input.scss -a {b: hsla(0, 100%, 50%, -0.1)} - -<===> alpha/below/output.css -a { - b: hsla(0, 100%, 50%, 0); -} diff --git a/spec/core_functions/color/hsl/four_args/out_of_gamut.hrx b/spec/core_functions/color/hsl/four_args/out_of_gamut.hrx new file mode 100644 index 0000000000..c13e978275 --- /dev/null +++ b/spec/core_functions/color/hsl/four_args/out_of_gamut.hrx @@ -0,0 +1,235 @@ +<===> hue/degenerate/positive_infinity/input.scss +a {b: hsl(calc(infinity), 100%, 50%)} + +<===> hue/degenerate/positive_infinity/output.css +a { + b: hsl(calc(NaN), 100%, 50%); +} + +<===> +================================================================================ +<===> hue/degenerate/negative_infinity/input.scss +a {b: hsl(calc(-infinity), 100%, 50%)} + +<===> hue/degenerate/negative_infinity/output.css +a { + b: hsl(calc(NaN), 100%, 50%); +} + +<===> +================================================================================ +<===> hue/degenerate/nan/input.scss +a {b: hsl(calc(NaN), 100%, 50%)} + +<===> hue/degenerate/nan/output.css +a { + b: hsl(calc(NaN), 100%, 50%); +} + +<===> +================================================================================ +<===> saturation/finite/input.scss +a {b: hsl(0, -0.1%, 50%, 0.5)} + +<===> saturation/finite/output.css +a { + b: hsla(0, 0%, 50%, 0.5); +} + +<===> +================================================================================ +<===> saturation/degenerate/positive_infinity/input.scss +a {b: hsl(0, calc(infinity), 50%)} + +<===> saturation/degenerate/positive_infinity/output.css +a { + b: hsl(0, calc(infinity * 1%), 50%); +} + +<===> saturation/degenerate/positive_infinity/warning +DEPRECATION WARNING: $saturation: Passing a number without unit % (calc(infinity)) is deprecated. + +To preserve current behavior: $saturation * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: hsl(0, calc(infinity), 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> saturation/degenerate/negative_infinity/input.scss +a {b: hsl(0, calc(-infinity), 50%)} + +<===> saturation/degenerate/negative_infinity/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> saturation/degenerate/negative_infinity/warning +DEPRECATION WARNING: $saturation: Passing a number without unit % (calc(-infinity)) is deprecated. + +To preserve current behavior: $saturation * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: hsl(0, calc(-infinity), 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> saturation/degenerate/nan/input.scss +a {b: hsl(0, calc(NaN), 50%)} + +<===> saturation/degenerate/nan/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> saturation/degenerate/nan/warning +DEPRECATION WARNING: $saturation: Passing a number without unit % (calc(NaN)) is deprecated. + +To preserve current behavior: $saturation * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: hsl(0, calc(NaN), 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> lightness/finite/input.scss +a {b: hsl(0, 100%, 9999%, 0.5)} + +<===> lightness/finite/output.css +a { + b: hsla(0, 100%, 9999%, 0.5); +} + +<===> +================================================================================ +<===> lightness/degenerate/positive_infinity/input.scss +a {b: hsl(0, 100%, calc(infinity))} + +<===> lightness/degenerate/positive_infinity/output.css +a { + b: hsl(0, 100%, calc(infinity * 1%)); +} + +<===> lightness/degenerate/positive_infinity/warning +DEPRECATION WARNING: $lightness: Passing a number without unit % (calc(infinity)) is deprecated. + +To preserve current behavior: $lightness * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: hsl(0, 100%, calc(infinity))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> lightness/degenerate/negative_infinity/input.scss +a {b: hsl(0, 100%, calc(-infinity))} + +<===> lightness/degenerate/negative_infinity/output.css +a { + b: hsl(0, 100%, calc(-infinity * 1%)); +} + +<===> lightness/degenerate/negative_infinity/warning +DEPRECATION WARNING: $lightness: Passing a number without unit % (calc(-infinity)) is deprecated. + +To preserve current behavior: $lightness * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: hsl(0, 100%, calc(-infinity))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> lightness/degenerate/nan/input.scss +a {b: hsl(0, 100%, calc(NaN))} + +<===> lightness/degenerate/nan/output.css +a { + b: hsl(0, 100%, calc(NaN * 1%)); +} + +<===> lightness/degenerate/nan/warning +DEPRECATION WARNING: $lightness: Passing a number without unit % (calc(NaN)) is deprecated. + +To preserve current behavior: $lightness * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: hsl(0, 100%, calc(NaN))} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/finite/above/input.scss +a {b: hsl(0, 100%, 50%, 1.1)} + +<===> alpha/finite/above/output.css +a { + b: hsl(0, 100%, 50%); +} + +<===> +================================================================================ +<===> alpha/finite/below/input.scss +a {b: hsla(0, 100%, 50%, -0.1)} + +<===> alpha/finite/below/output.css +a { + b: hsla(0, 100%, 50%, 0); +} + +<===> +================================================================================ +<===> alpha/degenerate/positive_infinity/input.scss +a {b: hsl(0, 100%, 50%, calc(infinity))} + +<===> alpha/degenerate/positive_infinity/output.css +a { + b: hsl(0, 100%, 50%); +} + +<===> +================================================================================ +<===> alpha/degenerate/negative_infinity/input.scss +a {b: hsl(0, 100%, 50%, calc(-infinity))} + +<===> alpha/degenerate/negative_infinity/output.css +a { + b: hsla(0, 100%, 50%, 0); +} + +<===> +================================================================================ +<===> alpha/degenerate/nan/input.scss +a {b: hsl(0, 100%, 50%, calc(NaN))} + +<===> alpha/degenerate/nan/output.css +a { + b: hsla(0, 100%, 50%, 0); +} diff --git a/spec/core_functions/color/hsl/one_arg/alpha.hrx b/spec/core_functions/color/hsl/one_arg/alpha.hrx index 4df1e93be0..ebd8fcc6f3 100644 --- a/spec/core_functions/color/hsl/one_arg/alpha.hrx +++ b/spec/core_functions/color/hsl/one_arg/alpha.hrx @@ -64,7 +64,7 @@ a {b: hsl(0 100% 9999% / 0.5)} <===> clamped/lightness/output.css a { - b: hsla(0, 100%, 100%, 0.5); + b: hsla(0, 100%, 9999%, 0.5); } <===> @@ -97,3 +97,24 @@ a {b: hsl(list.slash(180 60% 50%, 0))} a { b: hsla(180, 60%, 50%, 0); } + +<===> +================================================================================ +<===> missing/slash/input.scss +a {b: hsl(180 60% 50% / none)} + +<===> missing/slash/output.css +a { + b: hsl(180deg 60% 50% / none); +} + +<===> +================================================================================ +<===> missing/slash_list/input.scss +@use 'sass:list'; +a {b: hsl(list.slash(180 60% 50%, none))} + +<===> missing/slash_list/output.css +a { + b: hsl(180deg 60% 50% / none); +} diff --git a/spec/core_functions/color/hsl/one_arg/no_alpha.hrx b/spec/core_functions/color/hsl/one_arg/no_alpha.hrx index 4363177b55..a7f5257f71 100644 --- a/spec/core_functions/color/hsl/one_arg/no_alpha.hrx +++ b/spec/core_functions/color/hsl/one_arg/no_alpha.hrx @@ -28,12 +28,12 @@ a { <===> ================================================================================ -<===> clamped/saturation/above/input.scss +<===> out_of_gamut/saturation/above/input.scss a {b: hsl(0 500% 50%)} -<===> clamped/saturation/above/output.css +<===> out_of_gamut/saturation/above/output.css a { - b: hsl(0, 100%, 50%); + b: hsl(0, 500%, 50%); } <===> @@ -53,7 +53,7 @@ a {b: hsl(0 100% 500%)} <===> clamped/lightness/above/output.css a { - b: hsl(0, 100%, 100%); + b: hsl(0, 100%, 500%); } <===> @@ -63,7 +63,7 @@ a {b: hsl(0 100% -100%)} <===> clamped/lightness/below/output.css a { - b: hsl(0, 100%, 0%); + b: hsl(0, 100%, -100%); } <===> @@ -122,6 +122,36 @@ More info: https://sass-lang.com/d/function-units ' input.scss 1:7 root stylesheet +<===> +================================================================================ +<===> missing/hue/input.scss +a {b: hsl(none 100% 50%)} + +<===> missing/hue/output.css +a { + b: hsl(none 100% 50%); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +a {b: hsl(0 none 50%)} + +<===> missing/saturation/output.css +a { + b: hsl(0deg none 50%); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +a {b: hsl(0 100% none)} + +<===> missing/lightness/output.css +a { + b: hsl(0deg 100% none); +} + <===> ================================================================================ <===> named/input.scss diff --git a/spec/core_functions/color/hsl/one_arg/relative_color.hrx b/spec/core_functions/color/hsl/one_arg/relative_color.hrx index 2dcc4f7cbf..3f0e1021d2 100644 --- a/spec/core_functions/color/hsl/one_arg/relative_color.hrx +++ b/spec/core_functions/color/hsl/one_arg/relative_color.hrx @@ -55,7 +55,6 @@ a { b: hsl(from var(--c) h s l); } - <===> ================================================================================ <===> different_case/alpha/input.scss @@ -93,7 +92,7 @@ a { a {b: hsl("from" #aaa h s l / 25%)} <===> error/quoted/alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected hue channel to be a number, was "from". , 1 | a {b: hsl("from" #aaa h s l / 25%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -106,7 +105,7 @@ Error: Only 3 elements allowed, but 5 were passed. a {b: hsl("from" #aaa h s l)} <===> error/quoted/no_alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected hue channel to be a number, was "from". , 1 | a {b: hsl("from" #aaa h s l)} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -119,7 +118,7 @@ Error: Only 3 elements allowed, but 5 were passed. a {b: hsl(c #aaa h s l / 25%)} <===> error/wrong_keyword/alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected hue channel to be a number, was c. , 1 | a {b: hsl(c #aaa h s l / 25%)} | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -132,7 +131,7 @@ Error: Only 3 elements allowed, but 5 were passed. a {b: hsl(c #aaa h s l)} <===> error/wrong_keyword/no_alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected hue channel to be a number, was c. , 1 | a {b: hsl(c #aaa h s l)} | ^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx b/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx index b2d279ecb0..1f748089ab 100644 --- a/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx +++ b/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx @@ -26,7 +26,7 @@ a {b: hsl(1 2% string.unquote("calc(3%)") / 0.4)} <===> calc/string/arg_3/output.css a { - b: hsl(1 2% calc(3%)/0.4); + b: hsl(1, 2%, calc(3%), 0.4); } <===> @@ -37,7 +37,7 @@ a {b: hsl(1 2% 3% / string.unquote("calc(0.4)"))} <===> calc/string/arg_4/output.css a { - b: hsl(1 2% 3%/calc(0.4)); + b: hsl(1, 2%, 3%, calc(0.4)); } <===> @@ -67,7 +67,7 @@ a {b: hsl(1 2% calc(1px + 1%) / 0.4)} <===> calc/calculation/arg_3/output.css a { - b: hsl(1 2% calc(1px + 1%)/0.4); + b: hsl(1, 2%, calc(1px + 1%), 0.4); } <===> @@ -77,7 +77,7 @@ a {b: hsl(1 2% 3% / calc(1px + 1%))} <===> calc/calculation/arg_4/output.css a { - b: hsl(1 2% 3%/calc(1px + 1%)); + b: hsl(1, 2%, 3%, calc(1px + 1%)); } <===> @@ -107,7 +107,7 @@ a {b: hsl(1 2% var(--foo) / 0.4)} <===> var/arg_3/output.css a { - b: hsl(1 2% var(--foo)/0.4); + b: hsl(1, 2%, var(--foo), 0.4); } <===> @@ -117,7 +117,7 @@ a {b: hsl(1 2% 3% / var(--foo))} <===> var/arg_4/output.css a { - b: hsl(1 2% 3%/var(--foo)); + b: hsl(1, 2%, 3%, var(--foo)); } <===> @@ -147,7 +147,7 @@ a {b: hsl(1 2% env(--foo) / 0.4)} <===> env/arg_3/output.css a { - b: hsl(1 2% env(--foo)/0.4); + b: hsl(1, 2%, env(--foo), 0.4); } <===> @@ -157,7 +157,7 @@ a {b: hsl(1 2% 3% / env(--foo))} <===> env/arg_4/output.css a { - b: hsl(1 2% 3%/env(--foo)); + b: hsl(1, 2%, 3%, env(--foo)); } <===> @@ -190,7 +190,7 @@ a {b: hsl(1 2% string.unquote("min(3%)") / 0.4)} <===> min/string/arg_3/output.css a { - b: hsl(1 2% min(3%)/0.4); + b: hsl(1, 2%, min(3%), 0.4); } <===> @@ -201,7 +201,7 @@ a {b: hsl(1 2% 3% / string.unquote("min(0.4)"))} <===> min/string/arg_4/output.css a { - b: hsl(1 2% 3%/min(0.4)); + b: hsl(1, 2%, 3%, min(0.4)); } <===> @@ -234,7 +234,7 @@ a {b: hsl(1 2% string.unquote("max(3%)") / 0.4)} <===> max/string/arg_3/output.css a { - b: hsl(1 2% max(3%)/0.4); + b: hsl(1, 2%, max(3%), 0.4); } <===> @@ -245,7 +245,7 @@ a {b: hsl(1 2% 3% / string.unquote("max(0.4)"))} <===> max/string/arg_4/output.css a { - b: hsl(1 2% 3%/max(0.4)); + b: hsl(1, 2%, 3%, max(0.4)); } <===> @@ -278,7 +278,7 @@ a {b: hsl(1 2% string.unquote("clamp(3%, 4%, 5%)") / 0.4)} <===> clamp/string/arg_3/output.css a { - b: hsl(1 2% clamp(3%, 4%, 5%)/0.4); + b: hsl(1, 2%, clamp(3%, 4%, 5%), 0.4); } <===> @@ -289,7 +289,7 @@ a {b: hsl(1 2% 3% / string.unquote("clamp(0.4, 0.5, 0.6)"))} <===> clamp/string/arg_4/output.css a { - b: hsl(1 2% 3%/clamp(0.4, 0.5, 0.6)); + b: hsl(1, 2%, 3%, clamp(0.4, 0.5, 0.6)); } <===> diff --git a/spec/core_functions/color/hsl/one_arg/special_functions/options.yml b/spec/core_functions/color/hsl/one_arg/special_functions/options.yml deleted file mode 100644 index ce0ef8b813..0000000000 --- a/spec/core_functions/color/hsl/one_arg/special_functions/options.yml +++ /dev/null @@ -1,2 +0,0 @@ -:todo: - - libsass diff --git a/spec/core_functions/color/hsl/three_args/bounds.hrx b/spec/core_functions/color/hsl/three_args/bounds.hrx new file mode 100644 index 0000000000..7ea7a9ba3e --- /dev/null +++ b/spec/core_functions/color/hsl/three_args/bounds.hrx @@ -0,0 +1,54 @@ +<===> README.md +The W3C tests cover out-of-bounds hue, but not saturation or lightness. + +<===> +================================================================================ +<===> saturation/above/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(hsl(0, 200%, 50%)); + +<===> saturation/above/output.css +a { + value: hsl(0, 200%, 50%); + space: hsl; + channels: 0deg 200% 50% / 1; +} + +<===> +================================================================================ +<===> saturation/below/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(hsl(0, -100%, 50%)); + +<===> saturation/below/output.css +a { + value: hsl(0, 0%, 50%); + space: hsl; + channels: 0deg 0% 50% / 1; +} + +<===> +================================================================================ +<===> lightness/above/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(hsl(0, 100%, 500%)); + +<===> lightness/above/output.css +a { + value: hsl(0, 100%, 500%); + space: hsl; + channels: 0deg 100% 500% / 1; +} + +<===> +================================================================================ +<===> lightness/below/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(hsl(0, 100%, -100%)); + +<===> lightness/below/output.css +a { + value: hsl(0, 100%, -100%); + space: hsl; + channels: 0deg 100% -100% / 1; +} diff --git a/spec/core_functions/color/hsl/three_args/clamped.hrx b/spec/core_functions/color/hsl/three_args/clamped.hrx deleted file mode 100644 index 722b8f6e87..0000000000 --- a/spec/core_functions/color/hsl/three_args/clamped.hrx +++ /dev/null @@ -1,42 +0,0 @@ -<===> README.md -The W3C tests cover clamped hue, but not clamped saturation or lightness. - -<===> -================================================================================ -<===> saturation/above/input.scss -a {b: hsl(0, 500%, 50%)} - -<===> saturation/above/output.css -a { - b: hsl(0, 100%, 50%); -} - -<===> -================================================================================ -<===> saturation/below/input.scss -a {b: hsl(0, -100%, 50%)} - -<===> saturation/below/output.css -a { - b: hsl(0, 0%, 50%); -} - -<===> -================================================================================ -<===> lightness/above/input.scss -a {b: hsl(0, 100%, 500%)} - -<===> lightness/above/output.css -a { - b: hsl(0, 100%, 100%); -} - -<===> -================================================================================ -<===> lightness/below/input.scss -a {b: hsl(0, 100%, -100%)} - -<===> lightness/below/output.css -a { - b: hsl(0, 100%, 0%); -} diff --git a/spec/core_functions/color/hsl/three_args/out_of_gamut.hrx b/spec/core_functions/color/hsl/three_args/out_of_gamut.hrx new file mode 100644 index 0000000000..bed3d2b753 --- /dev/null +++ b/spec/core_functions/color/hsl/three_args/out_of_gamut.hrx @@ -0,0 +1,12 @@ +<===> saturation/above/input.scss +a {b: hsl(0, 500%, 50%)} + +<===> saturation/above/output.css +a { + b: hsl(0, 500%, 50%); +} + +<===> saturation/above/output-libsass.css +a { + b: red; +} diff --git a/spec/core_functions/color/hue.hrx b/spec/core_functions/color/hue.hrx index ba5367a574..5096d382bc 100644 --- a/spec/core_functions/color/hue.hrx +++ b/spec/core_functions/color/hue.hrx @@ -7,6 +7,19 @@ a { b: 359deg; } +<===> max/warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue(hsl(359, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> above_max/input.scss @@ -18,6 +31,19 @@ a { b: 180deg; } +<===> above_max/warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue(hsl(540, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss @@ -29,6 +55,19 @@ a { b: 0deg; } +<===> min/warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue(hsl(0, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> negative/input.scss @@ -40,6 +79,19 @@ a { b: 180deg; } +<===> negative/warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue(hsl(-180, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/input.scss @@ -51,6 +103,19 @@ a { b: 123deg; } +<===> middle/warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue(hsl(123, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> fraction/input.scss @@ -62,6 +127,19 @@ a { b: 0.5deg; } +<===> fraction/warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue(hsl(0.5, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss @@ -73,6 +151,19 @@ a { b: 234deg; } +<===> named/warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue($color: hsl(234, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -122,3 +213,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.hue(lch(0% 0 0deg))} + +<===> error/non_legacy/error +Error: color.hue() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.hue(lch(0% 0 0deg))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/hwb/error/five_args.hrx b/spec/core_functions/color/hwb/error/five_args.hrx index 3101c968bc..8828d7efc9 100644 --- a/spec/core_functions/color/hwb/error/five_args.hrx +++ b/spec/core_functions/color/hwb/error/five_args.hrx @@ -1,5 +1,5 @@ <===> input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 30%, 40%, 0.5, 0)} <===> error diff --git a/spec/core_functions/color/hwb/error/four_args.hrx b/spec/core_functions/color/hwb/error/four_args.hrx index 2813ed10c0..7a1e87c7ff 100644 --- a/spec/core_functions/color/hwb/error/four_args.hrx +++ b/spec/core_functions/color/hwb/error/four_args.hrx @@ -1,37 +1,23 @@ <===> hue/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb("foo", 30%, 40%, 0.5)} <===> hue/type/error -Error: $hue: "foo" is not a number. +Error: Expected hue channel to be a number, was "foo". , 2 | a {b: color.hwb("foo", 30%, 40%, 0.5)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet -<===> -================================================================================ -<===> hue/var/input.scss -@use 'sass:color'; -a {b: color.hwb(var(--c), 30%, 40%, 0.5)} - -<===> hue/var/error -Error: $hue: var(--c) is not a number. - , -2 | a {b: color.hwb(var(--c), 30%, 40%, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - <===> ================================================================================ <===> whiteness/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, "foo", 40%, 0.5)} <===> whiteness/type/error -Error: $whiteness: "foo" is not a number. +Error: Expected whiteness channel to be a number, was "foo". , 2 | a {b: color.hwb(0, "foo", 40%, 0.5)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -41,7 +27,7 @@ Error: $whiteness: "foo" is not a number. <===> ================================================================================ <===> whiteness/unit/none/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 30, 40%, 0.5)} <===> whiteness/unit/none/error @@ -55,7 +41,7 @@ Error: $whiteness: Expected 30 to have unit "%". <===> ================================================================================ <===> whiteness/unit/wrong/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 30px, 40%, 0.5)} <===> whiteness/unit/wrong/error @@ -66,56 +52,14 @@ Error: $whiteness: Expected 30px to have unit "%". ' input.scss 2:7 root stylesheet -<===> -================================================================================ -<===> whiteness/too_high/input.scss -@use 'sass:color'; -a {b: color.hwb(0, 101%, 40%, 0.5)} - -<===> whiteness/too_high/error -Error: $whiteness: Expected 101% to be within 0% and 100%. - , -2 | a {b: color.hwb(0, 101%, 40%, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_low/input.scss -@use 'sass:color'; -a {b: color.hwb(0, -1%, 40%, 0.5)} - -<===> whiteness/too_low/error -Error: $whiteness: Expected -1% to be within 0% and 100%. - , -2 | a {b: color.hwb(0, -1%, 40%, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/var/input.scss -@use 'sass:color'; -a {b: color.hwb(0, var(--c), 40%, 0.5)} - -<===> whiteness/var/error -Error: $whiteness: var(--c) is not a number. - , -2 | a {b: color.hwb(0, var(--c), 40%, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - <===> ================================================================================ <===> blackness/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 30%, "foo", 0.5)} <===> blackness/type/error -Error: $blackness: "foo" is not a number. +Error: Expected blackness channel to be a number, was "foo". , 2 | a {b: color.hwb(0, 30%, "foo", 0.5)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -125,7 +69,7 @@ Error: $blackness: "foo" is not a number. <===> ================================================================================ <===> blackness/unit/none/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 30%, 40, 0.5)} <===> blackness/unit/none/error @@ -139,7 +83,7 @@ Error: $blackness: Expected 40 to have unit "%". <===> ================================================================================ <===> blackness/unit/wrong/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 30%, 40px, 0.5)} <===> blackness/unit/wrong/error @@ -150,52 +94,10 @@ Error: $blackness: Expected 40px to have unit "%". ' input.scss 2:7 root stylesheet -<===> -================================================================================ -<===> blackness/too_high/input.scss -@use 'sass:color'; -a {b: color.hwb(0, 30%, 101%, 0.5)} - -<===> blackness/too_high/error -Error: $blackness: Expected 101% to be within 0% and 100%. - , -2 | a {b: color.hwb(0, 30%, 101%, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_low/input.scss -@use 'sass:color'; -a {b: color.hwb(0, 30%, -1%, 0.5)} - -<===> blackness/too_low/error -Error: $blackness: Expected -1% to be within 0% and 100%. - , -2 | a {b: color.hwb(0, 30%, -1%, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/var/input.scss -@use 'sass:color'; -a {b: color.hwb(0, 30%, var(--c), 0.5)} - -<===> blackness/var/error -Error: $blackness: var(--c) is not a number. - , -2 | a {b: color.hwb(0, 30%, var(--c), 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - <===> ================================================================================ <===> alpha/unit/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 0.5px)} <===> alpha/unit/error @@ -205,17 +107,3 @@ Error: $alpha: Expected 0.5px to have unit "%" or no units. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/var/input.scss -@use 'sass:color'; -a {b: color.hwb(0, 0%, 0%, var(--c))} - -<===> alpha/var/error -Error: $alpha: var(--c) is not a number. - , -2 | a {b: color.hwb(0, 0%, 0%, var(--c))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/hwb/error/one_arg.hrx b/spec/core_functions/color/hwb/error/one_arg.hrx index 003348e8c6..0f15c8f647 100644 --- a/spec/core_functions/color/hwb/error/one_arg.hrx +++ b/spec/core_functions/color/hwb/error/one_arg.hrx @@ -1,9 +1,9 @@ <===> list/empty/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(())} <===> list/empty/error -Error: Missing element $hue. +Error: $channels: Color component list may not be empty. , 2 | a {b: color.hwb(())} | ^^^^^^^^^^^^^ @@ -13,11 +13,11 @@ Error: Missing element $hue. <===> ================================================================================ <===> list/comma_separated/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb((0, 30%, 40%))} <===> list/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space- or slash-separated list, was (0, 30%, 40%) , 2 | a {b: color.hwb((0, 30%, 40%))} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -27,11 +27,11 @@ Error: $channels must be a space-separated list. <===> ================================================================================ <===> list/bracketed/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb([0 30% 40%])} <===> list/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [0 30% 40%] , 2 | a {b: color.hwb([0 30% 40%])} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -41,11 +41,11 @@ Error: $channels must be an unbracketed list. <===> ================================================================================ <===> list/one_element/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0)} <===> list/one_element/error -Error: Missing element $whiteness. +Error: $channels: The hwb color space has 3 channels but 0 has 1. , 2 | a {b: color.hwb(0)} | ^^^^^^^^^^^^ @@ -55,11 +55,11 @@ Error: Missing element $whiteness. <===> ================================================================================ <===> list/two_elements/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30%)} <===> list/two_elements/error -Error: Missing element $blackness. +Error: $channels: The hwb color space has 3 channels but (0 30%) has 2. , 2 | a {b: color.hwb(0 30%)} | ^^^^^^^^^^^^^^^^ @@ -69,11 +69,11 @@ Error: Missing element $blackness. <===> ================================================================================ <===> list/four_elements/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30% 40% 0.4)} <===> list/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The hwb color space has 3 channels but (0 30% 40% 0.4) has 4. , 2 | a {b: color.hwb(0 30% 40% 0.4)} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -83,39 +83,25 @@ Error: Only 3 elements allowed, but 4 were passed. <===> ================================================================================ <===> hue/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb("foo" 30% 40%)} <===> hue/type/error -Error: $hue: "foo" is not a number. +Error: $channels: Expected hue channel to be a number, was "foo". , 2 | a {b: color.hwb("foo" 30% 40%)} | ^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet -<===> -================================================================================ -<===> hue/var/input.scss -@use 'sass:color'; -a {b: color.hwb(var(--c) 30% 40%)} - -<===> hue/var/error -Error: $hue: var(--c) is not a number. - , -2 | a {b: color.hwb(var(--c) 30% 40%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - <===> ================================================================================ <===> whiteness/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 "foo" 40%)} <===> whiteness/type/error -Error: $whiteness: "foo" is not a number. +Error: $channels: Expected whiteness channel to be a number, was "foo". , 2 | a {b: color.hwb(0 "foo" 40%)} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -125,7 +111,7 @@ Error: $whiteness: "foo" is not a number. <===> ================================================================================ <===> whiteness/unit/none/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30 40%)} <===> whiteness/unit/none/error @@ -139,7 +125,7 @@ Error: $whiteness: Expected 30 to have unit "%". <===> ================================================================================ <===> whiteness/unit/wrong/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30px 40%)} <===> whiteness/unit/wrong/error @@ -150,56 +136,14 @@ Error: $whiteness: Expected 30px to have unit "%". ' input.scss 2:7 root stylesheet -<===> -================================================================================ -<===> whiteness/too_high/input.scss -@use 'sass:color'; -a {b: color.hwb(0 101% 40%)} - -<===> whiteness/too_high/error -Error: $whiteness: Expected 101% to be within 0% and 100%. - , -2 | a {b: color.hwb(0 101% 40%)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_low/input.scss -@use 'sass:color'; -a {b: color.hwb(0 -1% 40%)} - -<===> whiteness/too_low/error -Error: $whiteness: Expected -1% to be within 0% and 100%. - , -2 | a {b: color.hwb(0 -1% 40%)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/var/input.scss -@use 'sass:color'; -a {b: color.hwb(0 var(--c) 40%)} - -<===> whiteness/var/error -Error: $whiteness: var(--c) is not a number. - , -2 | a {b: color.hwb(0 var(--c) 40%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - <===> ================================================================================ <===> blackness/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30% "foo")} <===> blackness/type/error -Error: $blackness: "foo" is not a number. +Error: $channels: Expected blackness channel to be a number, was "foo". , 2 | a {b: color.hwb(0 30% "foo")} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -209,7 +153,7 @@ Error: $blackness: "foo" is not a number. <===> ================================================================================ <===> blackness/unit/none/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30% 40)} <===> blackness/unit/none/error @@ -223,7 +167,7 @@ Error: $blackness: Expected 40 to have unit "%". <===> ================================================================================ <===> blackness/unit/wrong/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30% 40px)} <===> blackness/unit/wrong/error @@ -234,98 +178,28 @@ Error: $blackness: Expected 40px to have unit "%". ' input.scss 2:7 root stylesheet -<===> -================================================================================ -<===> blackness/too_high/input.scss -@use 'sass:color'; -a {b: color.hwb(0 30% 101%)} - -<===> blackness/too_high/error -Error: $blackness: Expected 101% to be within 0% and 100%. - , -2 | a {b: color.hwb(0 30% 101%)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_low/input.scss -@use 'sass:color'; -a {b: color.hwb(0 30% -1%)} - -<===> blackness/too_low/error -Error: $blackness: Expected -1% to be within 0% and 100%. - , -2 | a {b: color.hwb(0 30% -1%)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/var/no_alpha/input.scss -@use 'sass:color'; -a {b: color.hwb(0 30% var(--c))} - -<===> blackness/var/no_alpha/error -Error: $blackness: var(--c) is not a number. - , -2 | a {b: color.hwb(0 30% var(--c))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/var/alpha/input.scss -@use 'sass:color'; -a {b: color.hwb(0 30% var(--c) / 0.5px)} - -<===> blackness/var/alpha/error -Error: Expected numeric channels, got "hwb(0 30% var(--c)/0.5px)". - , -2 | a {b: color.hwb(0 30% var(--c) / 0.5px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - <===> ================================================================================ <===> alpha/unit/input.scss -@use 'sass:color'; -a {b: color.hwb(0 0 0 / 0.5px)} +@use "sass:color"; +a {b: color.hwb(0 0% 0% / 0.5px)} <===> alpha/unit/error -Error: $whiteness: Expected 0 to have unit "%". - , -2 | a {b: color.hwb(0 0 0 / 0.5px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/var/input.scss -@use 'sass:color'; -a {b: color.hwb(0 0 0 / var(--c))} - -<===> alpha/var/error -Error: Expected numeric channels, got "hwb(0 0 0/var(--c))". +Error: $alpha: Expected 0.5px to have unit "%" or no units. , -2 | a {b: color.hwb(0 0 0 / var(--c))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.hwb(0 0% 0% / 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet <===> ================================================================================ <===> quoted_var_slash/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30% "var(--foo) / 0.4")} <===> quoted_var_slash/error -Error: $blackness: "var(--foo) / 0.4" is not a number. +Error: $channels: Expected blackness channel to be a number, was "var(--foo) / 0.4". , 2 | a {b: color.hwb(0 30% "var(--foo) / 0.4")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hwb/error/three_args.hrx b/spec/core_functions/color/hwb/error/three_args.hrx index ada9b7d6b2..c162afcc03 100644 --- a/spec/core_functions/color/hwb/error/three_args.hrx +++ b/spec/core_functions/color/hwb/error/three_args.hrx @@ -1,9 +1,9 @@ <===> hue/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb("foo", 100%, 50%)} <===> hue/type/error -Error: $hue: "foo" is not a number. +Error: Expected hue channel to be a number, was "foo". , 2 | a {b: color.hwb("foo", 100%, 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,11 +13,11 @@ Error: $hue: "foo" is not a number. <===> ================================================================================ <===> whiteness/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, "foo", 50%)} <===> whiteness/type/error -Error: $whiteness: "foo" is not a number. +Error: Expected whiteness channel to be a number, was "foo". , 2 | a {b: color.hwb(0, "foo", 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -27,11 +27,11 @@ Error: $whiteness: "foo" is not a number. <===> ================================================================================ <===> blackness/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 100%, "foo")} <===> blackness/type/error -Error: $blackness: "foo" is not a number. +Error: Expected blackness channel to be a number, was "foo". , 2 | a {b: color.hwb(0, 100%, "foo")} | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hwb/error/two_args.hrx b/spec/core_functions/color/hwb/error/two_args.hrx index d5f6cc76ec..c247beb1c7 100644 --- a/spec/core_functions/color/hwb/error/two_args.hrx +++ b/spec/core_functions/color/hwb/error/two_args.hrx @@ -1,5 +1,5 @@ <===> input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(#123, 0.5)} <===> error diff --git a/spec/core_functions/color/hwb/error/zero_args.hrx b/spec/core_functions/color/hwb/error/zero_args.hrx index 508a69d7bf..0fe1fe4e81 100644 --- a/spec/core_functions/color/hwb/error/zero_args.hrx +++ b/spec/core_functions/color/hwb/error/zero_args.hrx @@ -1,5 +1,5 @@ <===> input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb()} <===> error diff --git a/spec/core_functions/color/hwb/four_args.hrx b/spec/core_functions/color/hwb/four_args.hrx index 562bacabab..51e57a8454 100644 --- a/spec/core_functions/color/hwb/four_args.hrx +++ b/spec/core_functions/color/hwb/four_args.hrx @@ -1,38 +1,214 @@ +<===> hue/var/input.scss +@use "sass:color"; +a {b: color.hwb(var(--c), 30%, 40%, 0.5)} + +<===> hue/var/output.css +a { + b: hwb(var(--c) 30% 40% / 0.5); +} + +<===> +================================================================================ +<===> hue/degenerate/positive_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(calc(infinity), 30%, 40%, 0.5)} + +<===> hue/degenerate/positive_infinity/output.css +a { + b: hsla(0, 0%, 30%, 0.5); +} + +<===> +================================================================================ +<===> hue/degenerate/negative_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(calc(-infinity), 30%, 40%, 0.5)} + +<===> hue/degenerate/negative_infinity/output.css +a { + b: hsla(0, 0%, 30%, 0.5); +} + +<===> +================================================================================ +<===> hue/degenerate/nan/input.scss +@use "sass:color"; +a {b: color.hwb(calc(NaN), 30%, 40%, 0.5)} + +<===> hue/degenerate/nan/output.css +a { + b: hsla(0, 0%, 30%, 0.5); +} + +<===> +================================================================================ +<===> whiteness/above_max/input.scss +@use "sass:color"; +a {b: color.hwb(0, 101%, 40%, 0.5)} + +<===> whiteness/above_max/output.css +a { + b: hsla(0, 0%, 71.6312056738%, 0.5); +} + +<===> +================================================================================ +<===> whiteness/below_min/input.scss +@use "sass:color"; +a {b: color.hwb(0, -1%, 40%, 0.5)} + +<===> whiteness/below_min/output.css +a { + b: hsla(0, 103.3898305085%, 29.5%, 0.5); +} + +<===> +================================================================================ +<===> whiteness/var/input.scss +@use "sass:color"; +a {b: color.hwb(0, var(--c), 40%, 0.5)} + +<===> whiteness/var/output.css +a { + b: hwb(0 var(--c) 40% / 0.5); +} + +<===> +================================================================================ +<===> whiteness/degenerate/positive_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(0, calc(infinity * 1%), 40%, 0.5)} + +<===> whiteness/degenerate/positive_infinity/output.css +a { + b: hsla(calc(NaN), calc(NaN * 1%), calc(NaN * 1%), 0.5); +} + +<===> +================================================================================ +<===> whiteness/degenerate/negative_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(0, calc(-infinity * 1%), 40%, 0.5)} + +<===> whiteness/degenerate/negative_infinity/output.css +a { + b: hsla(calc(NaN), calc(NaN * 1%), calc(NaN * 1%), 0.5); +} + +<===> +================================================================================ +<===> whiteness/degenerate/nan/input.scss +@use "sass:color"; +a {b: color.hwb(0, calc(NaN * 1%), 40%, 0.5)} + +<===> whiteness/degenerate/nan/output.css +a { + b: hsla(calc(NaN), calc(NaN * 1%), calc(NaN * 1%), 0.5); +} + +<===> +================================================================================ +<===> blackness/above_max/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, 101%, 0.5)} + +<===> blackness/above_max/output.css +a { + b: hsla(0, 0%, 22.9007633588%, 0.5); +} + +<===> +================================================================================ +<===> blackness/below_min/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, -1%, 0.5)} + +<===> blackness/below_min/output.css +a { + b: hsla(0, 102.8985507246%, 65.5%, 0.5); +} + +<===> +================================================================================ +<===> blackness/var/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, var(--c), 0.5)} + +<===> blackness/var/output.css +a { + b: hwb(0 30% var(--c) / 0.5); +} + +<===> +================================================================================ +<===> blackness/degenerate/positive_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, calc(infinity * 1%), 0.5)} + +<===> blackness/degenerate/positive_infinity/output.css +a { + b: hsla(calc(NaN), calc(NaN * 1%), calc(NaN * 1%), 0.5); +} + +<===> +================================================================================ +<===> blackness/degenerate/negative_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, calc(-infinity * 1%), 0.5)} + +<===> blackness/degenerate/negative_infinity/output.css +a { + b: hsla(calc(NaN), calc(NaN * 1%), calc(NaN * 1%), 0.5); +} + +<===> +================================================================================ +<===> blackness/degenerate/nan/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, calc(NaN * 1%), 0.5)} + +<===> blackness/degenerate/nan/output.css +a { + b: hsla(calc(NaN), calc(NaN * 1%), calc(NaN * 1%), 0.5); +} + +<===> +================================================================================ <===> alpha/percent/negative/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, -10%)} <===> alpha/percent/negative/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0, 100%, 50%, 0); } <===> ================================================================================ <===> alpha/percent/min/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 0%)} <===> alpha/percent/min/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0, 100%, 50%, 0); } <===> ================================================================================ <===> alpha/percent/positive/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 45.6%)} <===> alpha/percent/positive/output.css a { - b: rgba(255, 0, 0, 0.456); + b: hsla(0, 100%, 50%, 0.456); } <===> ================================================================================ <===> alpha/percent/max/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 100%)} <===> alpha/percent/max/output.css @@ -43,7 +219,7 @@ a { <===> ================================================================================ <===> alpha/percent/above_max/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 250%)} <===> alpha/percent/above_max/output.css @@ -54,40 +230,40 @@ a { <===> ================================================================================ <===> alpha/unitless/negative/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, -10)} <===> alpha/unitless/negative/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0, 100%, 50%, 0); } <===> ================================================================================ <===> alpha/unitless/min/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 0)} <===> alpha/unitless/min/output.css a { - b: rgba(255, 0, 0, 0); + b: hsla(0, 100%, 50%, 0); } <===> ================================================================================ <===> alpha/unitless/positive/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 0.456)} <===> alpha/unitless/positive/output.css a { - b: rgba(255, 0, 0, 0.456); + b: hsla(0, 100%, 50%, 0.456); } <===> ================================================================================ <===> alpha/unitless/max/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 1)} <===> alpha/unitless/max/output.css @@ -98,7 +274,7 @@ a { <===> ================================================================================ <===> alpha/unitless/above_max/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0, 0%, 0%, 250)} <===> alpha/unitless/above_max/output.css @@ -106,13 +282,57 @@ a { b: red; } +<===> +================================================================================ +<===> alpha/var/input.scss +@use "sass:color"; +a {b: color.hwb(0, 0%, 0%, var(--c))} + +<===> alpha/var/output.css +a { + b: hwb(0 0% 0% / var(--c)); +} + +<===> +================================================================================ +<===> alpha/degenerate/positive_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, 40%, calc(infinity))} + +<===> alpha/degenerate/positive_infinity/output.css +a { + b: hsl(0, 33.3333333333%, 45%); +} + +<===> +================================================================================ +<===> alpha/degenerate/negative_infinity/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, 40%, calc(-infinity))} + +<===> alpha/degenerate/negative_infinity/output.css +a { + b: hsla(0, 33.3333333333%, 45%, 0); +} + +<===> +================================================================================ +<===> alpha/degenerate/nan/input.scss +@use "sass:color"; +a {b: color.hwb(0, 30%, 40%, calc(NaN))} + +<===> alpha/degenerate/nan/output.css +a { + b: hsla(0, 33.3333333333%, 45%, 0); +} + <===> ================================================================================ <===> named/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb($hue: 180, $whiteness: 30%, $blackness: 40%, $alpha: 0.4)} <===> named/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180, 33.3333333333%, 45%, 0.4); } diff --git a/spec/core_functions/color/hwb/global.hrx b/spec/core_functions/color/hwb/global.hrx new file mode 100644 index 0000000000..b7624e9128 --- /dev/null +++ b/spec/core_functions/color/hwb/global.hrx @@ -0,0 +1,281 @@ +<===> alpha/in_gamut/transparent/input.scss +a {b: hwb(180 30% 40% / 0)} + +<===> alpha/in_gamut/transparent/output.css +a { + b: hsla(180, 33.3333333333%, 45%, 0); +} + +<===> +================================================================================ +<===> alpha/in_gamut/opaque/input.scss +a {b: hwb(180 30% 40% / 1)} + +<===> alpha/in_gamut/opaque/output.css +a { + b: hsl(180, 33.3333333333%, 45%); +} + +<===> +================================================================================ +<===> alpha/in_gamut/partial/input.scss +a {b: hwb(180 30% 40% / 0.5)} + +<===> alpha/in_gamut/partial/output.css +a { + b: hsla(180, 33.3333333333%, 45%, 0.5); +} + +<===> +================================================================================ +<===> alpha/in_gamut/named/input.scss +a {b: hwb($channels: 180 30% 40% / 0.4)} + +<===> alpha/in_gamut/named/output.css +a { + b: hsla(180, 33.3333333333%, 45%, 0.4); +} + +<===> +================================================================================ +<===> alpha/in_gamut/parenthesized/input.scss +// Extra parens shouldn't cause the slash to be forced into division. +a {b: (hwb(180 30% 40% / 0.4))} + +<===> alpha/in_gamut/parenthesized/output.css +a { + b: hsla(180, 33.3333333333%, 45%, 0.4); +} + +<===> +================================================================================ +<===> alpha/clamped/above/input.scss +a {b: hwb(0 30% 40% / 1.1)} + +<===> alpha/clamped/above/output.css +a { + b: hsl(0, 33.3333333333%, 45%); +} + +<===> +================================================================================ +<===> alpha/clamped/below/input.scss +a {b: hwb(0 30% 40% / -0.1)} + +<===> alpha/clamped/below/output.css +a { + b: hsla(0, 33.3333333333%, 45%, 0); +} + +<===> +================================================================================ +<===> alpha/missing/slash/input.scss +a {b: hwb(0 30% 40% / none)} + +<===> alpha/missing/slash/output.css +a { + b: hwb(0deg 30% 40% / none); +} + +<===> +================================================================================ +<===> alpha/missing/slash_list/input.scss +@use 'sass:list'; +a {b: hwb(list.slash(0 30% 40%, none))} + +<===> alpha/missing/slash_list/output.css +a { + b: hwb(0deg 30% 40% / none); +} + +<===> +================================================================================ +<===> no_alpha/input.scss +a {b: hwb(180 30% 40%)} + +<===> no_alpha/output.css +a { + b: hsl(180, 33.3333333333%, 45%); +} + +<===> +================================================================================ +<===> named/input.scss +a {b: hwb($channels: 180 30% 40% / 0.4)} + +<===> named/output.css +a { + b: hsla(180, 33.3333333333%, 45%, 0.4); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +a {b: hwb(none 30% 40%)} + +<===> missing/hue/output.css +a { + b: hwb(none 30% 40%); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +a {b: hwb(0 none 40%)} + +<===> missing/whiteness/output.css +a { + b: hwb(0deg none 40%); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +a {b: hwb(0 30% none)} + +<===> missing/blackness/output.css +a { + b: hwb(0deg 30% none); +} + +<===> +================================================================================ +<===> relative_color/static/alpha/input.scss +a {b: hwb(from #aaa h w b / 25%)} + +<===> relative_color/static/alpha/output.css +a { + b: hwb(from #aaa h w b/25%); +} + +<===> +================================================================================ +<===> relative_color/static/no_alpha/input.scss +a {b: hwb(from #aaa h w b)} + +<===> relative_color/static/no_alpha/output.css +a { + b: hwb(from #aaa h w b); +} + +<===> +================================================================================ +<===> relative_color/calc/alpha/input.scss +a {b: hwb(from #aaa calc(h + 180deg) w b / 25%)} + +<===> relative_color/calc/alpha/output.css +a { + b: hwb(from #aaa calc(h + 180deg) w b/25%); +} + +<===> +================================================================================ +<===> relative_color/calc/no_alpha/input.scss +a {b: hwb(from #aaa calc(h + 180deg) w b)} + +<===> relative_color/calc/no_alpha/output.css +a { + b: hwb(from #aaa calc(h + 180deg) w b); +} + +<===> +================================================================================ +<===> relative_color/var/alpha/input.scss +a {b: hwb(from var(--c) h w b / 25%)} + +<===> relative_color/var/alpha/output.css +a { + b: hwb(from var(--c) h w b/25%); +} + +<===> +================================================================================ +<===> relative_color/var/no_alpha/input.scss +a {b: hwb(from var(--c) h w b)} +<===> relative_color/var/no_alpha/output.css +a { + b: hwb(from var(--c) h w b); +} + +<===> +================================================================================ +<===> relative_color/different_case/alpha/input.scss +a {b: hwb(From #aaa h w b / 25%)} + +<===> relative_color/different_case/alpha/output.css +a { + b: hwb(From #aaa h w b/25%); +} + +<===> +================================================================================ +<===> relative_color/different_case/no_alpha/input.scss +a {b: hwb(From #aaa h w b)} + +<===> relative_color/different_case/no_alpha/output.css +a { + b: hwb(From #aaa h w b); +} + +<===> +================================================================================ +<===> relative_color/slash_list_alpha/input.scss +@use "sass:list"; +a {b: hwb(list.slash(from #aaa h w b, 25%))} + +<===> relative_color/slash_list_alpha/output.css +a { + b: hwb(from #aaa h w b / 25%); +} + +<===> +================================================================================ +<===> relative_color/error/quoted/alpha/input.scss +a {b: hwb("from" #aaa h w b / 25%)} + +<===> relative_color/error/quoted/alpha/error +Error: $channels: Expected hue channel to be a number, was "from". + , +1 | a {b: hwb("from" #aaa h w b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/error/quoted/no_alpha/input.scss +a {b: hwb("from" #aaa h w b)} + +<===> relative_color/error/quoted/no_alpha/error +Error: $channels: Expected hue channel to be a number, was "from". + , +1 | a {b: hwb("from" #aaa h w b)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/error/wrong_keyword/alpha/input.scss +a {b: hwb(c #aaa h w b / 25%)} + +<===> relative_color/error/wrong_keyword/alpha/error +Error: $channels: Expected hue channel to be a number, was c. + , +1 | a {b: hwb(c #aaa h w b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/error/wrong_keyword/no_alpha/input.scss +a {b: hwb(c #aaa h w b)} + +<===> relative_color/error/wrong_keyword/no_alpha/error +Error: $channels: Expected hue channel to be a number, was c. + , +1 | a {b: hwb(c #aaa h w b)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/hwb/one_arg.hrx b/spec/core_functions/color/hwb/one_arg.hrx index 85d4d19265..65fdb7a8a1 100644 --- a/spec/core_functions/color/hwb/one_arg.hrx +++ b/spec/core_functions/color/hwb/one_arg.hrx @@ -1,98 +1,339 @@ +<===> hue/var/input.scss +@use "sass:color"; +a {b: color.hwb(var(--c) 30% 40%)} + +<===> hue/var/output.css +a { + b: hwb(var(--c) 30% 40%); +} + +<===> +================================================================================ +<===> whiteness/above_max/input.scss +@use "sass:color"; +a {b: color.hwb(0 101% 40%)} + +<===> whiteness/above_max/output.css +a { + b: hsl(0, 0%, 71.6312056738%); +} + +<===> +================================================================================ +<===> whiteness/below_min/input.scss +@use "sass:color"; +a {b: color.hwb(0 -1% 40%)} + +<===> whiteness/below_min/output.css +a { + b: hsl(0, 103.3898305085%, 29.5%); +} + +<===> +================================================================================ +<===> whiteness/var/input.scss +@use "sass:color"; +a {b: color.hwb(0 var(--c) 40%)} + +<===> whiteness/var/output.css +a { + b: hwb(0 var(--c) 40%); +} + +<===> +================================================================================ +<===> blackness/var/no_alpha/input.scss +@use "sass:color"; +a {b: color.hwb(0 30% var(--c))} + +<===> blackness/var/no_alpha/output.css +a { + b: hwb(0 30% var(--c)); +} + +<===> +================================================================================ +<===> blackness/var/alpha/input.scss +@use "sass:color"; +a {b: color.hwb(0 30% var(--c) / 0.5)} + +<===> blackness/var/alpha/output.css +a { + b: hwb(0 30% var(--c)/0.5); +} + +<===> +================================================================================ +<===> blackness/above_max/input.scss +@use "sass:color"; +a {b: color.hwb(0 30% 101%)} + +<===> blackness/above_max/output.css +a { + b: hsl(0, 0%, 22.9007633588%); +} + +<===> +================================================================================ +<===> blackness/below_min/input.scss +@use "sass:color"; +a {b: color.hwb(0 30% -1%)} + +<===> blackness/below_min/output.css +a { + b: hsl(0, 102.8985507246%, 65.5%); +} + +<===> +================================================================================ <===> alpha/in_gamut/transparent/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(180 30% 40% / 0)} <===> alpha/in_gamut/transparent/output.css a { - b: rgba(77, 153, 153, 0); + b: hsla(180, 33.3333333333%, 45%, 0); } <===> ================================================================================ <===> alpha/in_gamut/opaque/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(180 30% 40% / 1)} <===> alpha/in_gamut/opaque/output.css a { - b: #4d9999; + b: hsl(180, 33.3333333333%, 45%); } <===> ================================================================================ <===> alpha/in_gamut/partial/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(180 30% 40% / 0.5)} <===> alpha/in_gamut/partial/output.css a { - b: rgba(77, 153, 153, 0.5); + b: hsla(180, 33.3333333333%, 45%, 0.5); } <===> ================================================================================ <===> alpha/in_gamut/named/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb($channels: 180 30% 40% / 0.4)} <===> alpha/in_gamut/named/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180, 33.3333333333%, 45%, 0.4); } <===> ================================================================================ <===> alpha/in_gamut/parenthesized/input.scss -@use 'sass:color'; +@use "sass:color"; // Extra parens shouldn't cause the slash to be forced into division. a {b: (color.hwb(180 30% 40% / 0.4))} <===> alpha/in_gamut/parenthesized/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180, 33.3333333333%, 45%, 0.4); +} + +<===> +================================================================================ +<===> alpha/var/input.scss +@use "sass:color"; +a {b: color.hwb(0 0 0 / var(--c))} + +<===> alpha/var/output.css +a { + b: hwb(0 0 0/var(--c)); } <===> ================================================================================ <===> alpha/clamped/above/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30% 40% / 1.1)} <===> alpha/clamped/above/output.css a { - b: #994d4d; + b: hsl(0, 33.3333333333%, 45%); } <===> ================================================================================ <===> alpha/clamped/below/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0 30% 40% / -0.1)} <===> alpha/clamped/below/output.css a { - b: rgba(153, 77, 77, 0); + b: hsla(0, 33.3333333333%, 45%, 0); } <===> ================================================================================ <===> no_alpha/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(180 30% 40%)} <===> no_alpha/output.css a { - b: #4d9999; + b: hsl(180, 33.3333333333%, 45%); } <===> ================================================================================ <===> named/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb($channels: 180 30% 40% / 0.4)} <===> named/output.css a { - b: rgba(77, 153, 153, 0.4); + b: hsla(180, 33.3333333333%, 45%, 0.4); } + +<===> +================================================================================ +<===> relative_color/static/alpha/input.scss +a {b: hwb(from #aaa h w b / 25%)} + +<===> relative_color/static/alpha/output.css +a { + b: hwb(from #aaa h w b/25%); +} + +<===> +================================================================================ +<===> relative_color/static/no_alpha/input.scss +a {b: hwb(from #aaa h w b)} + +<===> relative_color/static/no_alpha/output.css +a { + b: hwb(from #aaa h w b); +} + +<===> +================================================================================ +<===> relative_color/calc/alpha/input.scss +a {b: hwb(from #aaa calc(h + 180deg) w b / 25%)} + +<===> relative_color/calc/alpha/output.css +a { + b: hwb(from #aaa calc(h + 180deg) w b/25%); +} + +<===> +================================================================================ +<===> relative_color/calc/no_alpha/input.scss +a {b: hwb(from #aaa calc(h + 180deg) w b)} + +<===> relative_color/calc/no_alpha/output.css +a { + b: hwb(from #aaa calc(h + 180deg) w b); +} + +<===> +================================================================================ +<===> relative_color/var/alpha/input.scss +a {b: hwb(from var(--c) h w b / 25%)} + +<===> relative_color/var/alpha/output.css +a { + b: hwb(from var(--c) h w b/25%); +} + +<===> +================================================================================ +<===> relative_color/var/no_alpha/input.scss +a {b: hwb(from var(--c) h w b)} +<===> relative_color/var/no_alpha/output.css +a { + b: hwb(from var(--c) h w b); +} + +<===> +================================================================================ +<===> relative_color/different_case/alpha/input.scss +a {b: hwb(From #aaa h w b / 25%)} + +<===> relative_color/different_case/alpha/output.css +a { + b: hwb(From #aaa h w b/25%); +} + +<===> +================================================================================ +<===> relative_color/different_case/no_alpha/input.scss +a {b: hwb(From #aaa h w b)} + +<===> relative_color/different_case/no_alpha/output.css +a { + b: hwb(From #aaa h w b); +} + +<===> +================================================================================ +<===> relative_color/slash_list_alpha/input.scss +@use "sass:list"; +a {b: hwb(list.slash(from #aaa h w b, 25%))} + +<===> relative_color/slash_list_alpha/output.css +a { + b: hwb(from #aaa h w b / 25%); +} + +<===> +================================================================================ +<===> relative_color/error/quoted/alpha/input.scss +a {b: hwb("from" #aaa h w b / 25%)} + +<===> relative_color/error/quoted/alpha/error +Error: $channels: Expected hue channel to be a number, was "from". + , +1 | a {b: hwb("from" #aaa h w b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/error/quoted/no_alpha/input.scss +a {b: hwb("from" #aaa h w b)} + +<===> relative_color/error/quoted/no_alpha/error +Error: $channels: Expected hue channel to be a number, was "from". + , +1 | a {b: hwb("from" #aaa h w b)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/error/wrong_keyword/alpha/input.scss +a {b: hwb(c #aaa h w b / 25%)} + +<===> relative_color/error/wrong_keyword/alpha/error +Error: $channels: Expected hue channel to be a number, was c. + , +1 | a {b: hwb(c #aaa h w b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> relative_color/error/wrong_keyword/no_alpha/input.scss +a {b: hwb(c #aaa h w b)} + +<===> relative_color/error/wrong_keyword/no_alpha/error +Error: $channels: Expected hue channel to be a number, was c. + , +1 | a {b: hwb(c #aaa h w b)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/hwb/three_args/bounds.hrx b/spec/core_functions/color/hwb/three_args/bounds.hrx new file mode 100644 index 0000000000..200dd6a649 --- /dev/null +++ b/spec/core_functions/color/hwb/three_args/bounds.hrx @@ -0,0 +1,221 @@ +<===> whiteness/above/blackness/zero/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 150%, 0%)); + +<===> whiteness/above/blackness/zero/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> whiteness/above/blackness/mid/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 150%, 10%)); + +<===> whiteness/above/blackness/mid/output.css +a { + value: hsl(0, 0%, 93.75%); + space: hwb; + channels: 0deg 93.75% 6.25% / 1; +} + +<===> +================================================================================ +<===> whiteness/above/blackness/above/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 150%, 120%)); + +<===> whiteness/above/blackness/above/output.css +a { + value: hsl(0, 0%, 55.5555555556%); + space: hwb; + channels: 0deg 55.5555555556% 44.4444444444% / 1; +} + +<===> +================================================================================ +<===> whiteness/above/blackness/below/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 150%, -20%)); + +<===> whiteness/above/blackness/below/output.css +a { + value: hsl(0, 0%, 115.3846153846%); + space: hwb; + channels: 0deg 115.3846153846% -15.3846153846% / 1; +} + +<===> +================================================================================ +<===> whiteness/below/blackness/zero/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, -50%, 0%)); + +<===> whiteness/below/blackness/zero/output.css +a { + value: hsl(0, 300%, 25%); + space: hwb; + channels: 0deg -50% 0% / 1; +} + +<===> +================================================================================ +<===> whiteness/below/blackness/mid/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, -50%, 10%)); + +<===> whiteness/below/blackness/mid/output.css +a { + value: hsl(0, 350%, 20%); + space: hwb; + channels: 0deg -50% 10% / 1; +} + +<===> +================================================================================ +<===> whiteness/below/blackness/above/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, -50%, 120%)); + +<===> whiteness/below/blackness/above/output.css +a { + value: hsl(180, 42.8571428571%, -35%); + space: hwb; + channels: 0deg -50% 120% / 1; +} + +<===> +================================================================================ +<===> whiteness/below/blackness/below/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, -50%, -20%)); + +<===> whiteness/below/blackness/below/output.css +a { + value: hsl(0, 242.8571428571%, 35%); + space: hwb; + channels: 0deg -50% -20% / 1; +} + +<===> +================================================================================ +<===> blackness/above/whiteness/zero/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 0%, 150%)); + +<===> blackness/above/whiteness/zero/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> blackness/above/whiteness/mid/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 10%, 150%)); + +<===> blackness/above/whiteness/mid/output.css +a { + value: hsl(0, 0%, 6.25%); + space: hwb; + channels: 0deg 6.25% 93.75% / 1; +} + +<===> +================================================================================ +<===> blackness/above/whiteness/above/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 120%, 150%)); + +<===> blackness/above/whiteness/above/output.css +a { + value: hsl(0, 0%, 44.4444444444%); + space: hwb; + channels: 0deg 44.4444444444% 55.5555555556% / 1; +} + +<===> +================================================================================ +<===> blackness/above/whiteness/below/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, -20%, 150%)); + +<===> blackness/above/whiteness/below/output.css +a { + value: hsl(0, 0%, -15.3846153846%); + space: hwb; + channels: 0deg -15.3846153846% 115.3846153846% / 1; +} + +<===> +================================================================================ +<===> blackness/below/whiteness/zero/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 0%, -50%)); + +<===> blackness/below/whiteness/zero/output.css +a { + value: hsl(0, 300%, 75%); + space: hwb; + channels: 0deg 0% -50% / 1; +} + +<===> +================================================================================ +<===> blackness/below/whiteness/mid/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 10%, -50%)); + +<===> blackness/below/whiteness/mid/output.css +a { + value: hsl(0, 350%, 80%); + space: hwb; + channels: 0deg 10% -50% / 1; +} + +<===> +================================================================================ +<===> blackness/below/whiteness/above/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, 120%, -50%)); + +<===> blackness/below/whiteness/above/output.css +a { + value: hsl(180, 42.8571428571%, 135%); + space: hwb; + channels: 0deg 120% -50% / 1; +} + +<===> +================================================================================ +<===> blackness/below/whiteness/below/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.hwb(0, -20%, -50%)); + +<===> blackness/below/whiteness/below/output.css +a { + value: hsl(0, 242.8571428571%, 65%); + space: hwb; + channels: 0deg -20% -50% / 1; +} diff --git a/spec/core_functions/color/hwb/three_args/named.hrx b/spec/core_functions/color/hwb/three_args/named.hrx index 90680131ba..63ff9dc833 100644 --- a/spec/core_functions/color/hwb/three_args/named.hrx +++ b/spec/core_functions/color/hwb/three_args/named.hrx @@ -1,9 +1,8 @@ <===> input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb($hue: 0, $whiteness: 30%, $blackness: 40%)} <===> output.css a { - b: #994d4d; + b: hsl(0, 33.3333333333%, 45%); } - diff --git a/spec/core_functions/color/hwb/three_args/units.hrx b/spec/core_functions/color/hwb/three_args/units.hrx index 2c422d22fb..7e6f17ec55 100644 --- a/spec/core_functions/color/hwb/three_args/units.hrx +++ b/spec/core_functions/color/hwb/three_args/units.hrx @@ -1,32 +1,32 @@ <===> hue/deg/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(0deg, 30%, 40%)} <===> hue/deg/output.css a { - b: #994d4d; + b: hsl(0, 33.3333333333%, 45%); } <===> ================================================================================ <===> hue/rad/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(1rad, 30%, 40%)} <===> hue/rad/output.css a { - b: #99964d; + b: hsl(57.2957795131, 33.3333333333%, 45%); } <===> ================================================================================ <===> hue/non_angle/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.hwb(1in, 30%, 40%)} <===> hue/non_angle/output.css a { - b: #994e4d; + b: hsl(1, 33.3333333333%, 45%); } <===> hue/non_angle/warning diff --git a/spec/core_functions/color/hwb/three_args/w3c/_test-hue.scss b/spec/core_functions/color/hwb/three_args/w3c/_test-hue.scss index 5d0189bb9e..de9d06e190 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/_test-hue.scss +++ b/spec/core_functions/color/hwb/three_args/w3c/_test-hue.scss @@ -1,4 +1,4 @@ -@use 'sass:color'; +@use "sass:color"; @mixin test-hue($hue) { @for $whiteness from 0 through 5 { diff --git a/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx b/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx index 5eeac1e6e0..34e65f76b1 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/blue_magentas.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #8000ff; + blackness-0: hsl(270, 100%, 50%); blackness-20: #6600cc; - blackness-40: #4d0099; + blackness-40: hsl(270, 100%, 30%); blackness-60: #330066; - blackness-80: #1a0033; + blackness-80: hsl(270, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #9933ff; - blackness-20: #8033cc; + blackness-20: hsl(270, 60%, 50%); blackness-40: rebeccapurple; - blackness-60: #4d3366; + blackness-60: hsl(270, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #b366ff; + blackness-0: hsl(270, 100%, 70%); blackness-20: #9966cc; - blackness-40: #806699; + blackness-40: hsl(270, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #cc99ff; - blackness-20: #b399cc; + blackness-20: hsl(270, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { - blackness-0: #e6ccff; + blackness-0: hsl(270, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/blues.hrx b/spec/core_functions/color/hwb/three_args/w3c/blues.hrx index 135c9b2e59..cab1db9697 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/blues.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/blues.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #333399; blackness-60: #333366; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #666699; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #9999ff; blackness-20: #9999cc; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { blackness-0: #ccccff; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx b/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx index 11146aa6c9..c9edff83d7 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/cyan_blues.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #0080ff; + blackness-0: hsl(210, 100%, 50%); blackness-20: #0066cc; - blackness-40: #004d99; + blackness-40: hsl(210, 100%, 30%); blackness-60: #003366; - blackness-80: #001a33; + blackness-80: hsl(210, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #3399ff; - blackness-20: #3380cc; + blackness-20: hsl(210, 60%, 50%); blackness-40: #336699; - blackness-60: #334d66; + blackness-60: hsl(210, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #66b3ff; + blackness-0: hsl(210, 100%, 70%); blackness-20: #6699cc; - blackness-40: #668099; + blackness-40: hsl(210, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ccff; - blackness-20: #99b3cc; + blackness-20: hsl(210, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { - blackness-0: #cce6ff; + blackness-0: hsl(210, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx b/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx index 21d546362d..31731c6f03 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/cyans.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #339999; blackness-60: #336666; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #669999; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ffff; blackness-20: #99cccc; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { blackness-0: #ccffff; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx b/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx index 13ed6d59c0..ea997a90a7 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/green_cyans.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #00ff80; + blackness-0: hsl(150, 100%, 50%); blackness-20: #00cc66; - blackness-40: #00994d; + blackness-40: hsl(150, 100%, 30%); blackness-60: #006633; - blackness-80: #00331a; + blackness-80: hsl(150, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #33ff99; - blackness-20: #33cc80; + blackness-20: hsl(150, 60%, 50%); blackness-40: #339966; - blackness-60: #33664d; + blackness-60: hsl(150, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #66ffb3; + blackness-0: hsl(150, 100%, 70%); blackness-20: #66cc99; - blackness-40: #669980; + blackness-40: hsl(150, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ffcc; - blackness-20: #99ccb3; + blackness-20: hsl(150, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { - blackness-0: #ccffe6; + blackness-0: hsl(150, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/greens.hrx b/spec/core_functions/color/hwb/three_args/w3c/greens.hrx index eda752e084..0433fa1d92 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/greens.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/greens.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #339933; blackness-60: #336633; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #669966; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #99ff99; blackness-20: #99cc99; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { blackness-0: #ccffcc; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx b/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx index 41d254bd5e..b142c620f9 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/magenta_reds.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #ff0080; + blackness-0: hsl(330, 100%, 50%); blackness-20: #cc0066; - blackness-40: #99004d; + blackness-40: hsl(330, 100%, 30%); blackness-60: #660033; - blackness-80: #33001a; + blackness-80: hsl(330, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #ff3399; - blackness-20: #cc3380; + blackness-20: hsl(330, 60%, 50%); blackness-40: #993366; - blackness-60: #66334d; + blackness-60: hsl(330, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #ff66b3; + blackness-0: hsl(330, 100%, 70%); blackness-20: #cc6699; - blackness-40: #996680; + blackness-40: hsl(330, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ff99cc; - blackness-20: #cc99b3; + blackness-20: hsl(330, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { - blackness-0: #ffcce6; + blackness-0: hsl(330, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx b/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx index 4d288342cf..dfc330a2f8 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/magentas.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #993399; blackness-60: #663366; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #996699; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ff99ff; blackness-20: #cc99cc; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { blackness-0: #ffccff; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx b/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx index 8075f9a5ab..735649a77e 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/oranges.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #ff8000; + blackness-0: hsl(30, 100%, 50%); blackness-20: #cc6600; - blackness-40: #994d00; + blackness-40: hsl(30, 100%, 30%); blackness-60: #663300; - blackness-80: #331a00; + blackness-80: hsl(30, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #ff9933; - blackness-20: #cc8033; + blackness-20: hsl(30, 60%, 50%); blackness-40: #996633; - blackness-60: #664d33; + blackness-60: hsl(30, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #ffb366; + blackness-0: hsl(30, 100%, 70%); blackness-20: #cc9966; - blackness-40: #998066; + blackness-40: hsl(30, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ffcc99; - blackness-20: #ccb399; + blackness-20: hsl(30, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { - blackness-0: #ffe6cc; + blackness-0: hsl(30, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/reds.hrx b/spec/core_functions/color/hwb/three_args/w3c/reds.hrx index 846cbd3240..6fe9f6d314 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/reds.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/reds.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #993333; blackness-60: #663333; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #996666; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ff9999; blackness-20: #cc9999; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { blackness-0: #ffcccc; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx b/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx index 24ff268a9e..0019525ed6 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/yellow_greens.hrx @@ -4,55 +4,55 @@ <===> output.css whiteness-0 { - blackness-0: #80ff00; + blackness-0: hsl(90, 100%, 50%); blackness-20: #66cc00; - blackness-40: #4d9900; + blackness-40: hsl(90, 100%, 30%); blackness-60: #336600; - blackness-80: #1a3300; + blackness-80: hsl(90, 100%, 10%); blackness-100: black; } whiteness-20 { blackness-0: #99ff33; - blackness-20: #80cc33; + blackness-20: hsl(90, 60%, 50%); blackness-40: #669933; - blackness-60: #4d6633; + blackness-60: hsl(90, 33.3333333333%, 30%); blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { - blackness-0: #b3ff66; + blackness-0: hsl(90, 100%, 70%); blackness-20: #99cc66; - blackness-40: #809966; + blackness-40: hsl(90, 20%, 50%); blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ccff99; - blackness-20: #b3cc99; + blackness-20: hsl(90, 33.3333333333%, 70%); blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { - blackness-0: #e6ffcc; + blackness-0: hsl(90, 100%, 90%); blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx b/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx index 76322fe532..267c529b0b 100644 --- a/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx +++ b/spec/core_functions/color/hwb/three_args/w3c/yellows.hrx @@ -18,7 +18,7 @@ whiteness-20 { blackness-40: #999933; blackness-60: #666633; blackness-80: #333333; - blackness-100: #2b2b2b; + blackness-100: hsl(0, 0%, 16.6666666667%); } whiteness-40 { @@ -27,32 +27,32 @@ whiteness-40 { blackness-40: #999966; blackness-60: #666666; blackness-80: #555555; - blackness-100: #494949; + blackness-100: hsl(0, 0%, 28.5714285714%); } whiteness-60 { blackness-0: #ffff99; blackness-20: #cccc99; blackness-40: #999999; - blackness-60: gray; - blackness-80: #6d6d6d; - blackness-100: #606060; + blackness-60: hsl(0, 0%, 50%); + blackness-80: hsl(0, 0%, 42.8571428571%); + blackness-100: hsl(0, 0%, 37.5%); } whiteness-80 { blackness-0: #ffffcc; blackness-20: #cccccc; blackness-40: #aaaaaa; - blackness-60: #929292; - blackness-80: gray; - blackness-100: #717171; + blackness-60: hsl(0, 0%, 57.1428571429%); + blackness-80: hsl(0, 0%, 50%); + blackness-100: hsl(0, 0%, 44.4444444444%); } whiteness-100 { blackness-0: white; - blackness-20: #d5d5d5; - blackness-40: #b6b6b6; - blackness-60: #9f9f9f; - blackness-80: #8e8e8e; - blackness-100: gray; + blackness-20: hsl(0, 0%, 83.3333333333%); + blackness-40: hsl(0, 0%, 71.4285714286%); + blackness-60: hsl(0, 0%, 62.5%); + blackness-80: hsl(0, 0%, 55.5555555556%); + blackness-100: hsl(0, 0%, 50%); } diff --git a/spec/core_functions/color/invert/alpha.hrx b/spec/core_functions/color/invert/alpha.hrx new file mode 100644 index 0000000000..efcb8880dd --- /dev/null +++ b/spec/core_functions/color/invert/alpha.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.invert(rgba(turquoise, 0.4))} + +<===> output.css +a { + b: rgba(191, 31, 47, 0.4); +} diff --git a/spec/core_functions/color/invert/error.hrx b/spec/core_functions/color/invert/error.hrx new file mode 100644 index 0000000000..8c17ee6535 --- /dev/null +++ b/spec/core_functions/color/invert/error.hrx @@ -0,0 +1,289 @@ +<===> too_few_args/input.scss +@use "sass:color"; +a {b: color.invert()} + +<===> too_few_args/error +Error: Missing argument $color. + ,--> input.scss +2 | a {b: color.invert()} + | ^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function invert($color, $weight: 100%, $space: null) { + | =========================================== declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +@use "sass:color"; +a {b: color.invert(turquoise, 0%, hsl, 1)} + +<===> too_many_args/error +Error: Only 3 arguments allowed, but 4 were passed. + ,--> input.scss +2 | a {b: color.invert(turquoise, 0%, hsl, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function invert($color, $weight: 100%, $space: null) { + | =========================================== declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> global/number_with_weight/input.scss +a {b: invert(1, 50%)} + +<===> global/number_with_weight/error +Error: Only one argument may be passed to the plain-CSS invert() function. + , +1 | a {b: invert(1, 50%)} + | ^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> global/type/color/input.scss +a {b: invert(c)} + +<===> global/type/color/error +Error: $color: c is not a color. + , +1 | a {b: invert(c)} + | ^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/legacy/same/implicit/input.scss +a {b: invert(rgb(none 10 20))} + +<===> missing/legacy/same/implicit/error +Error: $red: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: rgb(none 10 20)). + , +1 | a {b: invert(rgb(none 10 20))} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/legacy/same/explicit/input.scss +a {b: invert(hsl(0 40% none), $space: hsl)} + +<===> missing/legacy/same/explicit/error +Error: $lightness: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hsl(0deg 40% none)). + , +1 | a {b: invert(hsl(0 40% none), $space: hsl)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/legacy/same/hwb_hue/input.scss +a {b: invert(hwb(none 10% 20%), $space: hwb)} + +<===> missing/legacy/same/hwb_hue/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hwb(none 10% 20%)). + , +1 | a {b: invert(hwb(none 10% 20%), $space: hwb)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/legacy/analogous/input.scss +a {b: invert(rgb(10 none 20), $space: xyz)} + +<===> missing/legacy/analogous/error +Error: $y: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: color(xyz 0.0025142545 none 0.0067080366)). + , +1 | a {b: invert(rgb(10 none 20), $space: xyz)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/legacy/powerless/input.scss +a {b: invert(grey, $space: hsl)} + +<===> missing/legacy/powerless/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: hsl(none 0% 50.1960784314%)). + , +1 | a {b: invert(grey, $space: hsl)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/modern/same/input.scss +a {b: invert(color(srgb none 0.1 0.2), $space: srgb)} + +<===> missing/modern/same/error +Error: $red: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: color(srgb none 0.1 0.2)). + , +1 | a {b: invert(color(srgb none 0.1 0.2), $space: srgb)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/modern/analogous/input.scss +a {b: invert(color(rec2020 0.1 none 0.2), $space: xyz)} + +<===> missing/modern/analogous/error +Error: $y: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: color(xyz 0.0237000113 none 0.0589013339)). + , +1 | a {b: invert(color(rec2020 0.1 none 0.2), $space: xyz)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing/modern/powerless/input.scss +a {b: invert(color(rec2020 0.4 0.4 0.4), $space: lch)} + +<===> missing/modern/powerless/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lch(48.649404846% 0 none)). + , +1 | a {b: invert(color(rec2020 0.4 0.4 0.4), $space: lch)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/color/input.scss +@use "sass:color"; +a {b: color.invert(c)} + +<===> type/color/error +Error: $color: c is not a color. + , +2 | a {b: color.invert(c)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/weight/input.scss +@use "sass:color"; +a {b: color.invert(red, c)} + +<===> type/weight/error +Error: $weight: c is not a number. + , +2 | a {b: color.invert(red, c)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/space/input.scss +@use "sass:color"; +a {b: color.invert(red, 10%, 1)} + +<===> type/space/error +Error: $space: 1 is not a string. + , +2 | a {b: color.invert(red, 10%, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/quoted/input.scss +@use "sass:color"; +a {b: color.invert(red, 10%, "lch")} + +<===> space/quoted/error +Error: $space: Expected "lch" to be an unquoted string. + , +2 | a {b: color.invert(red, 10%, "lch")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/unknown/input.scss +@use "sass:color"; +a {b: color.invert(red, 10%, c)} + +<===> space/unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.invert(red, 10%, c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/missing/default_weight/input.scss +@use "sass:color"; +a {b: color.invert(lab(50% -10 10))} + +<===> space/missing/default_weight/error +Error: $color: To use color.invert() with non-legacy color lab(50% -10 10), you must provide a $space. + , +2 | a {b: color.invert(lab(50% -10 10))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/missing/zero_weight/input.scss +@use "sass:color"; +a {b: color.invert(lab(50% -10 10), 0%)} + +<===> space/missing/zero_weight/error +Error: $color: To use color.invert() with non-legacy color lab(50% -10 10), you must provide a $space. + , +2 | a {b: color.invert(lab(50% -10 10), 0%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> bounds/too_low/input.scss +@use "sass:color"; +a {b: color.invert(red, -0.001%)} + +<===> bounds/too_low/error +Error: $weight: Expected -0.001% to be within 0% and 100%. + , +2 | a {b: color.invert(red, -0.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> bounds/too_high/input.scss +@use "sass:color"; +a {b: color.invert(red, 100.001%)} + +<===> bounds/too_high/error +Error: $weight: Expected 100.001% to be within 0% and 100%. + , +2 | a {b: color.invert(red, 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/invert/global.hrx b/spec/core_functions/color/invert/global.hrx new file mode 100644 index 0000000000..e991643d4e --- /dev/null +++ b/spec/core_functions/color/invert/global.hrx @@ -0,0 +1,57 @@ +<===> legacy/input.scss +a {b: invert(red)} + +<===> legacy/output.css +a { + b: aqua; +} + +<===> +================================================================================ +<===> modern/input.scss +a {b: invert(color(srgb 0 0.4 1), $space: srgb)} + +<===> modern/output.css +a { + b: color(srgb 1 0.6 0); +} + +<===> +================================================================================ +<===> number/input.scss +a {b: invert(10%)} + +<===> number/output.css +a { + b: invert(10%); +} + +<===> +================================================================================ +<===> with_css_var/input.scss +a {b: invert(var(--c))} + +<===> with_css_var/output.css +a { + b: invert(var(--c)); +} + +<===> +================================================================================ +<===> with_calc/input.scss +a {b: invert(calc(1 + 2))} + +<===> with_calc/output.css +a { + b: invert(3); +} + +<===> +================================================================================ +<===> with_unquoted_calc/input.scss +a {b: invert(unquote('calc(1)'))} + +<===> with_unquoted_calc/output.css +a { + b: invert(calc(1)); +} diff --git a/spec/core_functions/color/invert.hrx b/spec/core_functions/color/invert/legacy.hrx similarity index 51% rename from spec/core_functions/color/invert.hrx rename to spec/core_functions/color/invert/legacy.hrx index 3b8bbf773f..b3720d9239 100644 --- a/spec/core_functions/color/invert.hrx +++ b/spec/core_functions/color/invert/legacy.hrx @@ -1,309 +1,273 @@ -<===> white/input.scss +<===> no_space/white/input.scss @use "sass:color"; a {b: color.invert(white)} -<===> white/output.css +<===> no_space/white/output.css a { b: black; } <===> ================================================================================ -<===> black/input.scss +<===> no_space/black/input.scss @use "sass:color"; a {b: color.invert(black)} -<===> black/output.css +<===> no_space/black/output.css a { b: white; } <===> ================================================================================ -<===> gray/input.scss +<===> no_space/gray/input.scss @use "sass:color"; a {b: color.invert(gray)} -<===> gray/output.css +<===> no_space/gray/output.css a { b: #7f7f7f; } <===> ================================================================================ -<===> turquoise/input.scss +<===> no_space/turquoise/input.scss @use "sass:color"; a {b: color.invert(turquoise)} -<===> turquoise/output.css +<===> no_space/turquoise/output.css a { b: #bf1f2f; } <===> ================================================================================ -<===> weighted/min/input.scss +<===> no_space/out_of_gamut/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect( + color.invert(color.change(rgb(0 50 0), $red: -100, $blue: 500)) +); + +<===> no_space/out_of_gamut/output.css +a { + value: hsl(45, 545.4545454545%, 21.568627451%); + space: rgb; + channels: 355 205 -245 / 1; +} + +<===> +================================================================================ +<===> no_space/weighted/min/input.scss @use "sass:color"; a {b: color.invert(turquoise, 0%)} -<===> weighted/min/output.css +<===> no_space/weighted/min/output.css a { b: turquoise; } <===> ================================================================================ -<===> weighted/max/input.scss +<===> no_space/weighted/max/input.scss @use "sass:color"; a {b: color.invert(turquoise, 100%)} -<===> weighted/max/output.css +<===> no_space/weighted/max/output.css a { b: #bf1f2f; } <===> ================================================================================ -<===> weighted/middle/input.scss +<===> no_space/weighted/middle/input.scss @use "sass:color"; a {b: color.invert(turquoise, 50%)} -<===> weighted/middle/output.css +<===> no_space/weighted/middle/output.css a { - b: gray; + b: rgb(127.5, 127.5, 127.5); } <===> ================================================================================ -<===> weighted/low/input.scss +<===> no_space/weighted/low/input.scss @use "sass:color"; a {b: color.invert(turquoise, 23%)} -<===> weighted/low/output.css +<===> no_space/weighted/low/output.css a { - b: #5db4ab; + b: rgb(93.21, 179.61, 170.97); } <===> ================================================================================ -<===> weighted/high/input.scss +<===> no_space/weighted/high/input.scss @use "sass:color"; a {b: color.invert(turquoise, 92%)} -<===> weighted/high/output.css +<===> no_space/weighted/high/output.css a { - b: #b52e3c; + b: rgb(180.84, 46.44, 59.88); } <===> ================================================================================ -<===> alpha/input.scss +<===> no_space/hsl/input.scss @use "sass:color"; -a {b: color.invert(rgba(turquoise, 0.4))} +a {b: color.invert(hsl(30deg 20% 40%))} -<===> alpha/output.css +<===> no_space/hsl/output.css a { - b: rgba(191, 31, 47, 0.4); + b: hsl(210, 20%, 60%); } <===> ================================================================================ -<===> named/input.scss +<===> no_space/hwb/input.scss @use "sass:color"; -a {b: color.invert($color: turquoise, $weight: 0%)} +a {b: color.invert(hsl(30deg 20% 40%))} -<===> named/output.css +<===> no_space/hwb/output.css a { - b: turquoise; + b: hsl(210, 20%, 60%); } <===> ================================================================================ -<===> units/weight/unitless/input.scss +<===> space/hsl/no_missing/input.scss @use "sass:color"; -a {b: color.invert(turquoise, 10)} +a {b: color.invert(hsl(30deg 20% 40%), $space: hsl)} -<===> units/weight/unitless/output.css +<===> space/hsl/no_missing/output.css a { - b: #4dcdc0; + b: hsl(210, 20%, 60%); } -<===> units/weight/unitless/warning -DEPRECATION WARNING: $weight: Passing a number without unit % (10) is deprecated. - -To preserve current behavior: $weight * 1% - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.invert(turquoise, 10)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - <===> ================================================================================ -<===> units/weight/unknown/input.scss +<===> space/hsl/missing/same/input.scss @use "sass:color"; -a {b: color.invert(turquoise, 10px)} +a {b: color.invert(hsl(30deg none 40%), $space: hsl)} -<===> units/weight/unknown/output.css +<===> space/hsl/missing/same/output.css a { - b: #4dcdc0; + b: hsl(210deg none 60%); } -<===> units/weight/unknown/warning -DEPRECATION WARNING: $weight: Passing a number without unit % (10px) is deprecated. - -To preserve current behavior: calc($weight / 1px * 1%) - -More info: https://sass-lang.com/d/function-units +<===> +================================================================================ +<===> space/hsl/missing/analogous/input.scss +@use "sass:color"; +a {b: color.invert(hsl(30deg none 40%), $space: lch)} +<===> space/hsl/missing/analogous/error +Error: $hue: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lch(43.192289563% none none)). , -2 | a {b: color.invert(turquoise, 10px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.invert(hsl(30deg none 40%), $space: lch)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ -<===> css_overload/input.scss +<===> space/hwb/no_missing/input.scss @use "sass:color"; -a {b: color.invert(1)} +a {b: color.invert(hwb(30deg 20% 40%), $space: hwb)} -<===> css_overload/output.css +<===> space/hwb/no_missing/output.css a { - b: invert(1); + b: #6699cc; } -<===> css_overload/warning -DEPRECATION WARNING: Passing a number (1) to color.invert() is deprecated. - -Recommendation: invert(1) - - , -2 | a {b: color.invert(1)} - | ^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - - <===> ================================================================================ -<===> error/too_few_args/input.scss +<===> space/hwb/missing/input.scss @use "sass:color"; -a {b: color.invert()} +a {b: color.invert(hwb(30deg none 40%), $space: hwb)} -<===> error/too_few_args/error -Error: Missing argument $color. - ,--> input.scss -2 | a {b: color.invert()} - | ^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function invert($color, $weight: 100%) { - | ============================= declaration - ' - input.scss 2:7 root stylesheet +<===> space/hwb/missing/output.css +a { + b: hwb(210deg 40% none); +} <===> ================================================================================ -<===> error/too_many_args/input.scss +<===> space/powerless/same/input.scss @use "sass:color"; -a {b: color.invert(turquoise, 0%, 1)} +a {b: color.invert(hsl(120deg 0% 40%), $space: hsl)} -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -2 | a {b: color.invert(turquoise, 0%, 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function invert($color, $weight: 100%) { - | ============================= declaration - ' - input.scss 2:7 root stylesheet +<===> space/powerless/same/output.css +a { + b: hsl(300, 0%, 60%); +} <===> ================================================================================ -<===> error/number_with_weight/input.scss +<===> space/powerless/different/input.scss @use "sass:color"; -a {b: color.invert(1, 50%)} +a {b: color.invert(hsl(120deg 0% 40%), $space: rgb)} -<===> error/number_with_weight/error -Error: Only one argument may be passed to the plain-CSS invert() function. - , -2 | a {b: color.invert(1, 50%)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet +<===> space/powerless/different/output.css +a { + b: hsl(0, 0%, 60%); +} <===> ================================================================================ -<===> error/type/color/input.scss +<===> space/modern/input.scss @use "sass:color"; -a {b: color.invert(c)} +a {b: color.invert(#abcdef, $space: display-p3)} -<===> error/type/color/error -Error: $color: c is not a color. - , -2 | a {b: color.invert(c)} - | ^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet +<===> space/modern/output.css +a { + b: rgb(81.948808543, 49.5520621504, 10.5024231747); +} <===> ================================================================================ -<===> error/type/css_variable/input.scss -@use 'sass:color'; -a {b: color.invert(var(--c))} +<===> units/weight/unitless/input.scss +@use "sass:color"; +a {b: color.invert(turquoise, 10)} -<===> error/type/css_variable/error -Error: $color: var(--c) is not a color. - , -2 | a {b: color.invert(var(--c))} - | ^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet +<===> units/weight/unitless/output.css +a { + b: rgb(76.7, 204.7, 191.9); +} -<===> -================================================================================ -<===> error/type/weight/input.scss -@use "sass:color"; -a {b: color.invert(red, c)} +<===> units/weight/unitless/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (10) is deprecated. -<===> error/type/weight/error -Error: $weight: c is not a number. - , -2 | a {b: color.invert(red, c)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet +To preserve current behavior: $weight * 1% -<===> -================================================================================ -<===> error/bounds/too_low/input.scss -@use "sass:color"; -a {b: color.invert(red, -0.001%)} +More info: https://sass-lang.com/d/function-units -<===> error/bounds/too_low/error -Error: $weight: Expected -0.001% to be within 0% and 100%. , -2 | a {b: color.invert(red, -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.invert(turquoise, 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ -<===> error/bounds/too_high/input.scss +<===> units/weight/unknown/input.scss @use "sass:color"; -a {b: color.invert(red, 100.001%)} +a {b: color.invert(turquoise, 10px)} + +<===> units/weight/unknown/output.css +a { + b: rgb(76.7, 204.7, 191.9); +} + +<===> units/weight/unknown/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (10px) is deprecated. + +To preserve current behavior: calc($weight / 1px * 1%) + +More info: https://sass-lang.com/d/function-units -<===> error/bounds/too_high/error -Error: $weight: Expected 100.001% to be within 0% and 100%. , -2 | a {b: color.invert(red, 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.invert(turquoise, 10px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/invert/modern.hrx b/spec/core_functions/color/invert/modern.hrx new file mode 100644 index 0000000000..bee9768452 --- /dev/null +++ b/spec/core_functions/color/invert/modern.hrx @@ -0,0 +1,140 @@ +<===> zero_min/input.scss +@use "sass:color"; +a {b: color.invert(color(rec2020 0 0.4 1), $space: rec2020)} + +<===> zero_min/output.css +a { + b: color(rec2020 1 0.6 0); +} + +<===> +================================================================================ +<===> negative_min/input.scss +@use "sass:color"; +a {b: color.invert(lab(20% -30 110), $space: lab)} + +<===> negative_min/output.css +a { + b: lab(80% 30 -110); +} + +<===> +================================================================================ +<===> polar/input.scss +@use "sass:color"; +a {b: color.invert(lch(20% 80 50deg), $space: lch)} + +<===> polar/output.css +a { + b: lch(80% 80 230deg); +} + +<===> +================================================================================ +<===> weight/min/input.scss +@use "sass:color"; +a {b: color.invert(color(a98-rgb 0.1 0.4 0.8), 0%, $space: a98-rgb)} + +<===> weight/min/output.css +a { + b: color(a98-rgb 0.1 0.4 0.8); +} + +<===> +================================================================================ +<===> weight/max/input.scss +@use "sass:color"; +a {b: color.invert(color(a98-rgb 0.1 0.4 0.8), 100%, $space: a98-rgb)} + +<===> weight/max/output.css +a { + b: color(a98-rgb 0.9 0.6 0.2); +} + +<===> +================================================================================ +<===> weight/middle/input.scss +@use "sass:color"; +a {b: color.invert(color(a98-rgb 0.1 0.4 0.8), 50%, $space: a98-rgb)} + +<===> weight/middle/output.css +a { + b: color(a98-rgb 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> weight/high/input.scss +@use "sass:color"; +a {b: color.invert(color(a98-rgb 0.1 0.4 0.8), 60%, $space: a98-rgb)} + +<===> weight/high/output.css +a { + b: color(a98-rgb 0.58 0.52 0.44); +} + +<===> +================================================================================ +<===> space/modern/input.scss +@use "sass:color"; +a {b: color.invert(lch(20% 80 50deg), $space: xyz)} + +<===> space/modern/output.css +a { + b: lch(98.9503159926% 3.6006542179 45.9089280707deg); +} + +<===> +================================================================================ +<===> space/legacy/input.scss +@use "sass:color"; +a {b: color.invert(lch(20% 80 50deg), $space: rgb)} + +<===> space/legacy/output.css +a { + b: color-mix(in lch, color(xyz 0.8040115061 1.0427791446 1.4858460828) 100%, black); +} + +<===> +================================================================================ +<===> space/case/input.scss +@use "sass:color"; +a {b: color.invert(lch(20% 80 50deg), $space: DISPLAY-p3)} + +<===> space/case/output.css +a { + b: lch(97.4036876937% 47.4823953357 211.8732507605deg); +} + +<===> +================================================================================ +<===> space/missing_converted/input.scss +@use "sass:color"; +a {b: color.invert(color(rec2020 none none none), $space: lab)} + +<===> space/missing_converted/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> space/powerless/same/input.scss +@use "sass:color"; +a {b: color.invert(lch(40% 0% 120deg), $space: lch)} + +<===> space/powerless/same/output.css +a { + b: lch(60% 0 300deg); +} + +<===> +================================================================================ +<===> space/powerless/different/input.scss +@use "sass:color"; +a {b: color.invert(lch(40% 0% 120deg), $space: lab)} + +<===> space/powerless/different/output.css +a { + b: lch(60% 0 none); +} diff --git a/spec/core_functions/color/invert/named.hrx b/spec/core_functions/color/invert/named.hrx new file mode 100644 index 0000000000..02e4c50045 --- /dev/null +++ b/spec/core_functions/color/invert/named.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.invert($color: turquoise, $weight: 10%, $space: oklch)} + +<===> output.css +a { + b: rgb(72.3071640492, 202.5503954693, 158.9647820206); +} diff --git a/spec/core_functions/color/invert/number.hrx b/spec/core_functions/color/invert/number.hrx new file mode 100644 index 0000000000..78daa6edd6 --- /dev/null +++ b/spec/core_functions/color/invert/number.hrx @@ -0,0 +1,19 @@ +<===> input.scss +@use "sass:color"; +a {b: color.invert(1)} + +<===> output.css +a { + b: invert(1); +} + +<===> warning +DEPRECATION WARNING: Passing a number (1) to color.invert() is deprecated. + +Recommendation: invert(1) + + , +2 | a {b: color.invert(1)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/is_in_gamut.hrx b/spec/core_functions/color/is_in_gamut.hrx new file mode 100644 index 0000000000..93ff599d73 --- /dev/null +++ b/spec/core_functions/color/is_in_gamut.hrx @@ -0,0 +1,370 @@ +<===> rgb/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color.change(black, $green: 300))} + +<===> rgb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> rgba/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color.change(rgba(0 122 180 / 0.4), $red: -1))} + +<===> rgba/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hwb/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(hwb(0 300% -1%))} + +<===> hwb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hsl/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(hsl(0 0% -1%))} + +<===> hsl/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> srgb/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(srgb 0 0 1.5))} + +<===> srgb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> srgb-linear/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(srgb-linear -1 0 0))} + +<===> srgb-linear/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> display-p3/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(display-p3 0 2 0))} + +<===> display-p3/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> a98-rgb/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(a98-rgb 0 1 -1))} + +<===> a98-rgb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> prophoto-rgb/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(prophoto-rgb 2 0 0))} + +<===> prophoto-rgb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> rec2020/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(rec2020 0.979780 -1 0.00579))} + +<===> rec2020/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> xyz/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(xyz 0.0426 0.0442 0.0364))} + +<===> xyz/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> xyz-d50/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(xyz-d50 0.2005 0.14089 0.4472))} + +<===> xyz-d50/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> xyz-d65/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(xyz-d65 0.21661 0.14602 0.59452))} + +<===> xyz-d65/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> lab/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(lab(5 110 115))} + +<===> lab/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> lch/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(lch(90.6 52.8 197))} + +<===> lch/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> oklab/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(oklab(0.44027 0.08818 -0.13386))} + +<===> oklab/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> oklch/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(oklch(70% 0.1 200))} + +<===> oklch/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hex/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(#f2ece4)} + +<===> hex/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> color_keyword/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(midnightblue)} + +<===> color_keyword/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.is-in-gamut($color: color(display-p3 1 1 0), $space: srgb)} + +<===> named/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> space/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(display-p3 1 1 0), oklch)} + +<===> space/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> wide_narrow/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(color(display-p3 1 1 0), hwb)} + +<===> wide_narrow/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> narrow_wide/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(hsl(50 40% 30%), oklab)} + +<===> narrow_wide/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> oklab_lch/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(oklab(0.44027 0.08818 -0.13386), lch)} + +<===> oklab_lch/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> error/too_few_args/input.scss +@use "sass:color"; +a {b: color.is-in-gamut()} + +<===> error/too_few_args/error +Error: Missing argument $color. + ,--> input.scss +2 | a {b: color.is-in-gamut()} + | ^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-in-gamut($color, $space: null) { + | ================================= declaration + ' + input.scss 2:7 root stylesheet + +<===> error/too_few_args/error + +<===> +================================================================================ +<===> error/too_many_args/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(rgb(0 255 0), hwb, c)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +2 | a {b: color.is-in-gamut(rgb(0 255 0), hwb, c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-in-gamut($color, $space: null) { + | ================================= declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/type/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(1)} + +<===> error/type/error +Error: $color: 1 is not a color. + , +2 | a {b: color.is-in-gamut(1)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/space_unknown/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(rgb(0 255 0), c)} + +<===> error/space_unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.is-in-gamut(rgb(0 255 0), c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/invalid_character_start/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(rgb(0 255 0), .hsl)} + +<===> error/invalid_character_start/error +Error: Expected digit. + , +2 | a {b: color.is-in-gamut(rgb(0 255 0), .hsl)} + | ^ + ' + input.scss 2:40 root stylesheet + +<===> +================================================================================ +<===> error/invalid_character_end/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(rgb(0 255 0), hsl.)} + +<===> error/invalid_character_end/error +Error: Expected identifier. + , +2 | a {b: color.is-in-gamut(rgb(0 255 0), hsl.)} + | ^ + ' + input.scss 2:43 root stylesheet + +<===> +================================================================================ +<===> error/quoted/input.scss +@use "sass:color"; +a {b: color.is-in-gamut(rgb(0 255 0), "hsl")} + +<===> error/quoted/error +Error: $space: Expected "hsl" to be an unquoted string. + , +2 | a {b: color.is-in-gamut(rgb(0 255 0), "hsl")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + diff --git a/spec/core_functions/color/is_legacy.hrx b/spec/core_functions/color/is_legacy.hrx new file mode 100644 index 0000000000..ce11bdc4a2 --- /dev/null +++ b/spec/core_functions/color/is_legacy.hrx @@ -0,0 +1,269 @@ +<===> rgb/input.scss +@use "sass:color"; +a {b: color.is-legacy(rgb(0 255 0))} + +<===> rgb/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> rgba/input.scss +@use "sass:color"; +a {b: color.is-legacy(rgba(72 122 180 / .2))} + +<===> rgba/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hwb/input.scss +@use "sass:color"; +a {b: color.is-legacy(hwb(0 50% 0%))} + +<===> hwb/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hsl/input.scss +@use "sass:color"; +a {b: color.is-legacy(hsl(110 31% 32%))} + +<===> hsl/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hex/input.scss +@use "sass:color"; +a {b: color.is-legacy(#f2ece4)} + +<===> hex/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.is-legacy($color: rgb(255 0 0))} + +<===> named/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> color_keyword/input.scss +@use "sass:color"; +a {b: color.is-legacy(midnightblue)} + +<===> color_keyword/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> srgb/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(srgb 0.45098 0.07843 0.823530))} + +<===> srgb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> srgb-linear/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(srgb-linear 0.45098 0.07843 0.823530))} + +<===> srgb-linear/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> display-p3/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(display-p3 0.515 0.35 0.3 / 1))} + +<===> display-p3/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> a98-rgb/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(a98-rgb 0 1 0))} + +<===> a98-rgb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> prophoto-rgb/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(prophoto-rgb 0.42444 0.934918 0.190922))} + +<===> prophoto-rgb/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> rec2020/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(rec2020 0.42053 0.979780 0.00579))} + +<===> rec2020/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> xyz/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(xyz 0.0426 0.0442 0.0364))} + +<===> xyz/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> xyz-d50/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(xyz-d50 0.2005 0.14089 0.4472))} + +<===> xyz-d50/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> xyz-d65/input.scss +@use "sass:color"; +a {b: color.is-legacy(color(xyz-d65 0.21661 0.14602 0.59452))} + +<===> xyz-d65/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> lab/input.scss +@use "sass:color"; +a {b: color.is-legacy(lab(5 110 115))} + +<===> lab/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> lch/input.scss +@use "sass:color"; +a {b: color.is-legacy(lch(90.6 52.8 197))} + +<===> lch/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> oklab/input.scss +@use "sass:color"; +a {b: color.is-legacy(oklab(0.44027 0.08818 -0.13386))} + +<===> oklab/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> oklch/input.scss +@use "sass:color"; +a {b: color.is-legacy(oklch(70% 0.1 200))} + +<===> oklch/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> error/too_few_args/input.scss +@use "sass:color"; +a {b: color.is-legacy()} + +<===> error/too_few_args/error +Error: Missing argument $color. + ,--> input.scss +2 | a {b: color.is-legacy()} + | ^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-legacy($color) { + | ================= declaration + ' + input.scss 2:7 root stylesheet + +<===> error/too_few_args/error + +<===> +================================================================================ +<===> error/too_many_args/input.scss +@use "sass:color"; +a {b: color.is-legacy(rgb(0 255 0), a)} + +<===> error/too_many_args/error +Error: Only 1 argument allowed, but 2 were passed. + ,--> input.scss +2 | a {b: color.is-legacy(rgb(0 255 0), a)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-legacy($color) { + | ================= declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/type/input.scss +@use "sass:color"; +a {b: color.is-legacy(1)} + +<===> error/type/error +Error: $color: 1 is not a color. + , +2 | a {b: color.is-legacy(1)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/is_missing.hrx b/spec/core_functions/color/is_missing.hrx new file mode 100644 index 0000000000..b545e79eb2 --- /dev/null +++ b/spec/core_functions/color/is_missing.hrx @@ -0,0 +1,235 @@ +<===> false/explicit/input.scss +@use "sass:color"; +a {b: color.is-missing(#abcdef, "red")} + +<===> false/explicit/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/not_powerless/converted/non_legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(color.to-space(#aaaaab, lch), "hue")} + +<===> false/not_powerless/converted/non_legacy/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/not_powerless/converted/legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(color.to-space(#aaaaab, hsl), "hue")} + +<===> false/not_powerless/converted/legacy/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/not_powerless/direct/non_legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(lch(50% 1% 0deg), "hue")} + +<===> false/not_powerless/direct/non_legacy/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/not_powerless/direct/legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(hsl(0deg 50% 1%), "hue")} + +<===> false/not_powerless/direct/legacy/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/powerless/direct/non_legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(lch(50% 0% 0deg), "hue")} + +<===> false/powerless/direct/non_legacy/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/powerless/direct/legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(hsl(0deg 50% 0%), "hue")} + +<===> false/powerless/direct/legacy/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/powerless/converted/legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(color.to-space(#aaaaaa, hsl), "hue")} + +<===> false/powerless/converted/legacy/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> true/explicit/non_legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(lab(50% 30 none), "b")} + +<===> true/explicit/non_legacy/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/explicit/legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(rgb(none 30 100), "red")} + +<===> true/explicit/legacy/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/powerless/converted/non_legacy/input.scss +@use "sass:color"; +a {b: color.is-missing(color.to-space(#aaaaaa, lch), "hue")} + +<===> true/powerless/converted/non_legacy/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.is-missing($color: black, $channel: "red")} + +<===> named/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> error/too_few_args/input.scss +@use "sass:color"; +a {b: color.is-missing(black)} + +<===> error/too_few_args/error +Error: Missing argument $channel. + ,--> input.scss +2 | a {b: color.is-missing(black)} + | ^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-missing($color, $channel) { + | ============================ declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +@use "sass:color"; +a {b: color.is-missing(black, "red", rgb)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +2 | a {b: color.is-missing(black, "red", rgb)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-missing($color, $channel) { + | ============================ declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color/input.scss +@use "sass:color"; +a {b: color.is-missing("black", "red")} + +<===> error/type/color/error +Error: $color: "black" is not a color. + , +2 | a {b: color.is-missing("black", "red")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/type/channel/input.scss +@use "sass:color"; +a {b: color.is-missing(black, red)} + +<===> error/type/channel/error +Error: $channel: red is not a string. + , +2 | a {b: color.is-missing(black, red)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/channel/wrong_space/input.scss +@use "sass:color"; +a {b: color.is-missing(black, "hue")} + +<===> error/channel/wrong_space/error +Error: $channel: Color black doesn't have a channel named "hue". + , +2 | a {b: color.is-missing(black, "hue")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/channel/unquoted/input.scss +@use "sass:color"; +a {b: color.is-missing(hsl(0deg 50% 50%), hue)} + +<===> error/channel/unquoted/error +Error: $channel: Expected hue to be a quoted string. + , +2 | a {b: color.is-missing(hsl(0deg 50% 50%), hue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/channel/wrong_case/input.scss +@use "sass:color"; +a {b: color.is-missing(black, "RED")} + +<===> error/channel/wrong_case/error +Error: $channel: Color black doesn't have a channel named "RED". + , +2 | a {b: color.is-missing(black, "RED")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/is_powerless/error.hrx b/spec/core_functions/color/is_powerless/error.hrx new file mode 100644 index 0000000000..8011f86f8e --- /dev/null +++ b/spec/core_functions/color/is_powerless/error.hrx @@ -0,0 +1,159 @@ +<===> too_few_args/input.scss +@use "sass:color"; +a {b: color.is-powerless(black)} + +<===> too_few_args/error +Error: Missing argument $channel. + ,--> input.scss +2 | a {b: color.is-powerless(black)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-powerless($color, $channel, $space: null) { + | ============================================ declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, "red", rgb, c)} + +<===> too_many_args/error +Error: Only 3 arguments allowed, but 4 were passed. + ,--> input.scss +2 | a {b: color.is-powerless(black, "red", rgb, c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function is-powerless($color, $channel, $space: null) { + | ============================================ declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/color/input.scss +@use "sass:color"; +a {b: color.is-powerless(c, "red")} + +<===> type/color/error +Error: $color: c is not a color. + , +2 | a {b: color.is-powerless(c, "red")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/channel/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, 1)} + +<===> type/channel/error +Error: $channel: 1 is not a string. + , +2 | a {b: color.is-powerless(black, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/space/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, "red", $space: 1)} + +<===> type/space/error +Error: $space: 1 is not a string. + , +2 | a {b: color.is-powerless(black, "red", $space: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/unquoted/input.scss +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 0% 0%), hue)} + +<===> channel/unquoted/error +Error: $channel: Expected hue to be a quoted string. + , +2 | a {b: color.is-powerless(hsl(0deg 0% 0%), hue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/unknown/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, "c")} + +<===> channel/unknown/error +Error: $channel: Color black doesn't have a channel named "c". + , +2 | a {b: color.is-powerless(black, "c")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/wrong_space/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, "hue")} + +<===> channel/wrong_space/error +Error: $channel: Color black doesn't have a channel named "hue". + , +2 | a {b: color.is-powerless(black, "hue")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> channel/wrong_case/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, "RED")} + +<===> channel/wrong_case/error +Error: $channel: Color black doesn't have a channel named "RED". + , +2 | a {b: color.is-powerless(black, "RED")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/quoted/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, "red", $space: "rgb")} + +<===> space/quoted/error +Error: $space: Expected "rgb" to be an unquoted string. + , +2 | a {b: color.is-powerless(black, "red", $space: "rgb")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/unknown/input.scss +@use "sass:color"; +a {b: color.is-powerless(black, "red", $space: c)} + +<===> space/unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.is-powerless(black, "red", $space: c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/is_powerless/hsl.hrx b/spec/core_functions/color/is_powerless/hsl.hrx new file mode 100644 index 0000000000..1cb72da4d7 --- /dev/null +++ b/spec/core_functions/color/is_powerless/hsl.hrx @@ -0,0 +1,84 @@ +<===> hue/positive_saturation/input.scss +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 50% 50%), "hue")} + +<===> hue/positive_saturation/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/zero_saturation/input.scss +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 0% 50%), "hue")} + +<===> hue/zero_saturation/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/near_zero_saturation/input.scss +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 0.000000000001% 50%), "hue")} + +<===> hue/near_zero_saturation/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/full_lightness/input.scss +// These used to be considered powerless by the CSS spec, but are no longer, so +// Sass shouldn't consdier it powerless either. +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 50% 100%), "hue")} + +<===> hue/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/zero_lightness/input.scss +// These used to be considered powerless by the CSS spec, but are no longer, so +// Sass shouldn't consdier it powerless either. +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 50% 0%), "hue")} + +<===> hue/zero_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> saturation/README.md +These used to be considered powerless by the CSS spec, but are no longer, so +Sass shouldn't consdier them powerless either. + +<===> +================================================================================ +<===> saturation/full_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 0% 100%), "saturation")} + +<===> saturation/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> saturation/zero_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(hsl(0deg 0% 0%), "saturation")} + +<===> saturation/zero_lightness/output.css +a { + b: false; +} diff --git a/spec/core_functions/color/is_powerless/hwb.hrx b/spec/core_functions/color/is_powerless/hwb.hrx new file mode 100644 index 0000000000..2968d29e24 --- /dev/null +++ b/spec/core_functions/color/is_powerless/hwb.hrx @@ -0,0 +1,74 @@ +<===> hue/not_greyscale/input.scss +@use "sass:color"; +a {b: color.is-powerless(hwb(0deg 30% 40%), "hue")} + +<===> hue/not_greyscale/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/full_whiteness/input.scss +@use "sass:color"; +a {b: color.is-powerless(hwb(0deg 100% 0%), "hue")} + +<===> hue/full_whiteness/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/full_blackness/input.scss +@use "sass:color"; +a {b: color.is-powerless(hwb(0deg 0% 100%), "hue")} + +<===> hue/full_blackness/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/grey/input.scss +@use "sass:color"; +a {b: color.is-powerless(hwb(0deg 40% 60%), "hue")} + +<===> hue/grey/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/normalized_grey/input.scss +@use "sass:color"; +a {b: color.is-powerless(hwb(0deg 60% 80%), "hue")} + +<===> hue/normalized_grey/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/out_of_gamut/colorful/input.scss +@use "sass:color"; +a {b: color.is-powerless(hwb(0deg -30% 50%), "hue")} + +<===> hue/out_of_gamut/colorful/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/out_of_gamut/grey/input.scss +@use "sass:color"; +a {b: color.is-powerless(hwb(0deg -30% 130%), "hue")} + +<===> hue/out_of_gamut/grey/output.css +a { + b: true; +} diff --git a/spec/core_functions/color/is_powerless/lab.hrx b/spec/core_functions/color/is_powerless/lab.hrx new file mode 100644 index 0000000000..30cf426b0c --- /dev/null +++ b/spec/core_functions/color/is_powerless/lab.hrx @@ -0,0 +1,47 @@ +<===> README.md +These used to be considered powerless by the CSS spec, but are no longer, so +Sass shouldn't consdier them powerless either. + +<===> +================================================================================ +<===> a/full_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(lab(100% 0 0), "a")} + +<===> a/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> a/zero_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(lab(0% 0 0), "a")} + +<===> a/zero_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> b/full_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(lab(100% 0 0), "b")} + +<===> b/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> b/zero_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(lab(0% 0 0), "b")} + +<===> b/zero_lightness/output.css +a { + b: false; +} diff --git a/spec/core_functions/color/is_powerless/lch.hrx b/spec/core_functions/color/is_powerless/lch.hrx new file mode 100644 index 0000000000..0f07f3f56e --- /dev/null +++ b/spec/core_functions/color/is_powerless/lch.hrx @@ -0,0 +1,84 @@ +<===> hue/positive_chroma/input.scss +@use "sass:color"; +a {b: color.is-powerless(lch(50% 50% 0deg), "hue")} + +<===> hue/positive_chroma/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/zero_chroma/input.scss +@use "sass:color"; +a {b: color.is-powerless(lch(50% 0% 0deg), "hue")} + +<===> hue/zero_chroma/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/near_zero_chroma/input.scss +@use "sass:color"; +a {b: color.is-powerless(lch(50% 0.000000000001% 0deg), "hue")} + +<===> hue/near_zero_chroma/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/full_lightness/input.scss +// These used to be considered powerless by the CSS spec, but are no longer, so +// Sass shouldn't consdier it powerless either. +@use "sass:color"; +a {b: color.is-powerless(lch(100% 50% 0deg), "hue")} + +<===> hue/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/zero_lightness/input.scss +// These used to be considered powerless by the CSS spec, but are no longer, so +// Sass shouldn't consdier it powerless either. +@use "sass:color"; +a {b: color.is-powerless(lch(0% 50% 0deg), "hue")} + +<===> hue/zero_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> chroma/README.md +These used to be considered powerless by the CSS spec, but are no longer, so +Sass shouldn't consdier them powerless either. + +<===> +================================================================================ +<===> chroma/full_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(lch(100% 0% 0deg), "chroma")} + +<===> chroma/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> chroma/zero_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(lch(0% 0% 0deg), "chroma")} + +<===> chroma/zero_lightness/output.css +a { + b: false; +} diff --git a/spec/core_functions/color/is_powerless/named.hrx b/spec/core_functions/color/is_powerless/named.hrx new file mode 100644 index 0000000000..2168d3a323 --- /dev/null +++ b/spec/core_functions/color/is_powerless/named.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.is-powerless($color: red, $channel: "a", $space: lab)} + +<===> output.css +a { + b: false; +} diff --git a/spec/core_functions/color/is_powerless/oklab.hrx b/spec/core_functions/color/is_powerless/oklab.hrx new file mode 100644 index 0000000000..4c92e26e2f --- /dev/null +++ b/spec/core_functions/color/is_powerless/oklab.hrx @@ -0,0 +1,47 @@ +<===> README.md +These used to be considered powerless by the CSS spec, but are no longer, so +Sass shouldn't consdier them powerless either. + +<===> +================================================================================ +<===> a/full_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklab(100% 0 0), "a")} + +<===> a/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> a/zero_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklab(0% 0 0), "a")} + +<===> a/zero_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> b/full_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklab(100% 0 0), "b")} + +<===> b/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> b/zero_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklab(0% 0 0), "b")} + +<===> b/zero_lightness/output.css +a { + b: false; +} diff --git a/spec/core_functions/color/is_powerless/oklch.hrx b/spec/core_functions/color/is_powerless/oklch.hrx new file mode 100644 index 0000000000..64d17911e8 --- /dev/null +++ b/spec/core_functions/color/is_powerless/oklch.hrx @@ -0,0 +1,84 @@ +<===> hue/positive_chroma/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklch(50% 50% 0deg), "hue")} + +<===> hue/positive_chroma/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/zero_chroma/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklch(50% 0% 0deg), "hue")} + +<===> hue/zero_chroma/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/near_zero_chroma/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklch(50% 0.000000000001% 0deg), "hue")} + +<===> hue/near_zero_chroma/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> hue/full_lightness/input.scss +// These used to be considered powerless by the CSS spec, but are no longer, so +// Sass shouldn't consdier it powerless either. +@use "sass:color"; +a {b: color.is-powerless(oklch(100% 50% 0deg), "hue")} + +<===> hue/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> hue/zero_lightness/input.scss +// These used to be considered powerless by the CSS spec, but are no longer, so +// Sass shouldn't consdier it powerless either. +@use "sass:color"; +a {b: color.is-powerless(oklch(0% 50% 0deg), "hue")} + +<===> hue/zero_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> chroma/README.md +These used to be considered powerless by the CSS spec, but are no longer, so +Sass shouldn't consdier them powerless either. + +<===> +================================================================================ +<===> chroma/full_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklch(100% 0% 0deg), "chroma")} + +<===> chroma/full_lightness/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> chroma/zero_lightness/input.scss +@use "sass:color"; +a {b: color.is-powerless(oklch(0% 0% 0deg), "chroma")} + +<===> chroma/zero_lightness/output.css +a { + b: false; +} diff --git a/spec/core_functions/color/is_powerless/space.hrx b/spec/core_functions/color/is_powerless/space.hrx new file mode 100644 index 0000000000..92eac48ebe --- /dev/null +++ b/spec/core_functions/color/is_powerless/space.hrx @@ -0,0 +1,19 @@ +<===> powerless/input.scss +@use "sass:color"; +a {b: color.is-powerless(grey, "hue", $space: hsl)} + +<===> powerless/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> not_powerless/input.scss +@use "sass:color"; +a {b: color.is-powerless(grey, "a", $space: lab)} + +<===> not_powerless/output.css +a { + b: false; +} diff --git a/spec/core_functions/color/lab/alpha.hrx b/spec/core_functions/color/lab/alpha.hrx new file mode 100644 index 0000000000..f5cbdb3bed --- /dev/null +++ b/spec/core_functions/color/lab/alpha.hrx @@ -0,0 +1,196 @@ +<===> transparent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(0 255 127 / 0)); + +<===> transparent/output.css +a { + value: lab(0% 255 127 / 0); + space: lab; + channels: 0% 255 127 / 0; +} + +<===> +================================================================================ +<===> opaque/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / 1)); + +<===> opaque/output.css +a { + value: lab(1% 2 3); + space: lab; + channels: 1% 2 3 / 1; +} + +<===> +================================================================================ +<===> partial/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / 0.4)); + +<===> partial/output.css +a { + value: lab(1% 2 3 / 0.4); + space: lab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> percent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / 40%)); + +<===> percent/output.css +a { + value: lab(1% 2 3 / 0.4); + space: lab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 -3 / calc(infinity))); + +<===> degenerate/positive_infinity/output.css +a { + value: lab(1% 2 -3); + space: lab; + channels: 1% 2 -3 / 1; +} + +<===> +================================================================================ +<===> degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 -3 / calc(-infinity))); + +<===> degenerate/negative_infinity/output.css +a { + value: lab(1% 2 -3 / 0); + space: lab; + channels: 1% 2 -3 / 0; +} + +<===> +================================================================================ +<===> degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 -3 / calc(NaN))); + +<===> degenerate/nan/output.css +a { + value: lab(1% 2 -3 / 0); + space: lab; + channels: 1% 2 -3 / 0; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab($channels: 1% 2 3 / 0.4)); + +<===> named/output.css +a { + value: lab(1% 2 3 / 0.4); + space: lab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> slash_list/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(lab(list.slash(1% 2 3, 0.4))); + +<===> slash_list/output.css +a { + value: lab(1% 2 3 / 0.4); + space: lab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> none/slash/b/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 none / 0.4)); + +<===> none/slash/b/output.css +a { + value: lab(1% 2 none / 0.4); + space: lab; + channels: 1% 2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / none)); + +<===> none/slash/alpha/output.css +a { + value: lab(1% 2 3 / none); + space: lab; + channels: 1% 2 3 / none; +} + +<===> +================================================================================ +<===> none/slash/b_and_alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 none / none)); + +<===> none/slash/b_and_alpha/output.css +a { + value: lab(1% 2 none / none); + space: lab; + channels: 1% 2 none / none; +} + +<===> +================================================================================ +<===> none/slash_list/b/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(lab(list.slash(1% 2 none, 0.4))); + +<===> none/slash_list/b/output.css +a { + value: lab(1% 2 none / 0.4); + space: lab; + channels: 1% 2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash_list/alpha/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(lab(list.slash(1% 2 3, none))); + +<===> none/slash_list/alpha/output.css +a { + value: lab(1% 2 3 / none); + space: lab; + channels: 1% 2 3 / none; +} + +<===> +================================================================================ +<===> none/slash_list/b_and_alpha/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(lab(list.slash(1% 2 none, none))); + +<===> none/slash_list/b_and_alpha/output.css +a { + value: lab(1% 2 none / none); + space: lab; + channels: 1% 2 none / none; +} diff --git a/spec/core_functions/color/lab/error.hrx b/spec/core_functions/color/lab/error.hrx new file mode 100644 index 0000000000..c5d57a3cbf --- /dev/null +++ b/spec/core_functions/color/lab/error.hrx @@ -0,0 +1,286 @@ +<===> unit/lightness/input.scss +a {b: lab(1px 2 3)} + +<===> unit/lightness/error +Error: $lightness: Expected 1px to have unit "%" or no units. + , +1 | a {b: lab(1px 2 3)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/a/input.scss +a {b: lab(1% 2px 3)} + +<===> unit/a/error +Error: $a: Expected 2px to have unit "%" or no units. + , +1 | a {b: lab(1% 2px 3)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/b/input.scss +a {b: lab(1% 2 3px)} + +<===> unit/b/error +Error: $b: Expected 3px to have unit "%" or no units. + , +1 | a {b: lab(1% 2 3px)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash/input.scss +a {b: lab(1% 2 3/0.4px)} + +<===> unit/alpha/slash/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +1 | a {b: lab(1% 2 3/0.4px)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: lab(list.slash(1% 2 3, 0.4px))} + +<===> unit/alpha/slash_list/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +2 | a {b: lab(list.slash(1% 2 3, 0.4px))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/lightness/input.scss +a {b: lab(c 2 3)} + +<===> type/lightness/error +Error: $channels: Expected lightness channel to be a number, was c. + , +1 | a {b: lab(c 2 3)} + | ^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/a/input.scss +a {b: lab(1% c 3)} + +<===> type/a/error +Error: $channels: Expected a channel to be a number, was c. + , +1 | a {b: lab(1% c 3)} + | ^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/b/direct/input.scss +a {b: lab(1% 2 c)} + +<===> type/b/direct/error +Error: $channels: Expected b channel to be a number, was c. + , +1 | a {b: lab(1% 2 c)} + | ^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/b/slash/input.scss +a {b: lab(1% 2 c / 0.4)} + +<===> type/b/slash/error +Error: $channels: Expected b channel to be a number, was c. + , +1 | a {b: lab(1% 2 c / 0.4)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: lab(list.slash(1% 2 3, c))} + +<===> type/alpha/slash_list/error +Error: $channels: c is not a number. + , +2 | a {b: lab(list.slash(1% 2 3, c))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/alpha/slash/input.scss +@use 'sass:list'; +a {b: lab(1% 2 3 / c)} + +<===> type/alpha/slash/error +Error: $channels: c is not a number. + , +2 | a {b: lab(1% 2 3 / c)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/bracketed/input.scss +a {b: lab([1% 2 3])} + +<===> list/bracketed/error +Error: $channels: Expected an unbracketed list, was [1% 2 3] + , +1 | a {b: lab([1% 2 3])} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/comma/input.scss +a {b: lab((1%, 2, 3))} + +<===> list/comma/error +Error: $channels: Expected a space- or slash-separated list, was (1%, 2, 3) + , +1 | a {b: lab((1%, 2, 3))} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/three/input.scss +@use 'sass:list'; +a {b: lab(list.slash(1%, 2, 3))} + +<===> list/slash/three/error +Error: $channels: Only 2 slash-separated elements allowed, but 3 were passed. + , +2 | a {b: lab(list.slash(1%, 2, 3))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/one/input.scss +@use 'sass:list'; +$single-arg-slash-separated: list.append((), 1% 2 3, $separator: slash); +a {b: lab($single-arg-slash-separated)} + +<===> list/slash/one/error +Error: $channels: Only 2 slash-separated elements allowed, but 1 was passed. + , +3 | a {b: lab($single-arg-slash-separated)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/empty/input.scss +a {b: lab(())} + +<===> list/empty/error +Error: $channels: Color component list may not be empty. + , +1 | a {b: lab(())} + | ^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/empty_space/input.scss +@use 'sass:list'; +$empty-space: list.join((), (), $separator: space); +a {b: lab(())} + +<===> list/empty_space/error +Error: $channels: Color component list may not be empty. + , +3 | a {b: lab(())} + | ^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/too_few_channels/input.scss +a {b: lab(1% 2)} + +<===> list/too_few_channels/error +Error: $channels: The lab color space has 3 channels but (1% 2) has 2. + , +1 | a {b: lab(1% 2)} + | ^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/too_many_channels/input.scss +a {b: lab(1% 2 3 0.4)} + +<===> list/too_many_channels/error +Error: $channels: The lab color space has 3 channels but (1% 2 3 0.4) has 4. + , +1 | a {b: lab(1% 2 3 0.4)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/input.scss +a {b: lab()} + +<===> too_few_args/error +Error: Missing argument $channels. + ,--> input.scss +1 | a {b: lab()} + | ^^^^^ invocation + ' + ,--> sass:color +1 | @function lab($channels) { + | ============== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +a {b: lab(1%, 2, 3, 0.4)} + +<===> too_many_args/error +Error: Only 1 argument allowed, but 4 were passed. + ,--> input.scss +1 | a {b: lab(1%, 2, 3, 0.4)} + | ^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function lab($channels) { + | ============== declaration + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/lab/no_alpha.hrx b/spec/core_functions/color/lab/no_alpha.hrx new file mode 100644 index 0000000000..a8dbf05b22 --- /dev/null +++ b/spec/core_functions/color/lab/no_alpha.hrx @@ -0,0 +1,322 @@ +<===> unitless/ab/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 -3)); + +<===> unitless/ab/in_range/output.css +a { + value: lab(1% 2 -3); + space: lab; + channels: 1% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/ab/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 126 300)); + +<===> unitless/ab/above_range/output.css +a { + value: lab(1% 126 300); + space: lab; + channels: 1% 126 300 / 1; +} + +<===> +================================================================================ +<===> unitless/ab/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% -126 -300)); + +<===> unitless/ab/below_range/output.css +a { + value: lab(1% -126 -300); + space: lab; + channels: 1% -126 -300 / 1; +} + +<===> +================================================================================ +<===> unitless/a/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% calc(infinity) -3)); + +<===> unitless/a/degenerate/positive_infinity/output.css +a { + value: lab(1% calc(infinity) -3); + space: lab; + channels: 1% calc(infinity) -3 / 1; +} + +<===> +================================================================================ +<===> unitless/a/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% calc(-infinity) -3)); + +<===> unitless/a/degenerate/negative_infinity/output.css +a { + value: lab(1% calc(-infinity) -3); + space: lab; + channels: 1% calc(-infinity) -3 / 1; +} + +<===> +================================================================================ +<===> unitless/a/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% calc(NaN) -3)); + +<===> unitless/a/degenerate/nan/output.css +a { + value: lab(1% calc(NaN) -3); + space: lab; + channels: 1% calc(NaN) -3 / 1; +} + +<===> +================================================================================ +<===> unitless/b/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 calc(infinity))); + +<===> unitless/b/degenerate/positive_infinity/output.css +a { + value: lab(1% 2 calc(infinity)); + space: lab; + channels: 1% 2 calc(infinity) / 1; +} + +<===> +================================================================================ +<===> unitless/b/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 calc(-infinity))); + +<===> unitless/b/degenerate/negative_infinity/output.css +a { + value: lab(1% 2 calc(-infinity)); + space: lab; + channels: 1% 2 calc(-infinity) / 1; +} + +<===> +================================================================================ +<===> unitless/b/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 calc(NaN))); + +<===> unitless/b/degenerate/nan/output.css +a { + value: lab(1% 2 calc(NaN)); + space: lab; + channels: 1% 2 calc(NaN) / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(10 2 -3)); + +<===> unitless/lightness/in_range/output.css +a { + value: lab(10% 2 -3); + space: lab; + channels: 10% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(101 2 3)); + +<===> unitless/lightness/above_range/output.css +a { + value: lab(100% 2 3); + space: lab; + channels: 100% 2 3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(-1 2 3)); + +<===> unitless/lightness/below_range/output.css +a { + value: lab(0% 2 3); + space: lab; + channels: 0% 2 3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(calc(infinity) 2 -3)); + +<===> unitless/lightness/degenerate/positive_infinity/output.css +a { + value: lab(100% 2 -3); + space: lab; + channels: 100% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(calc(-infinity) 2 -3)); + +<===> unitless/lightness/degenerate/negative_infinity/output.css +a { + value: lab(0% 2 -3); + space: lab; + channels: 0% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(calc(NaN) 2 -3)); + +<===> unitless/lightness/degenerate/nan/output.css +a { + value: lab(0% 2 -3); + space: lab; + channels: 0% 2 -3 / 1; +} + +<===> +================================================================================ +<===> percent/ab/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2% -3%)); + +<===> percent/ab/in_range/output.css +a { + value: lab(1% 2.5 -3.75); + space: lab; + channels: 1% 2.5 -3.75 / 1; +} + +<===> +================================================================================ +<===> percent/ab/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 101% 150%)); + +<===> percent/ab/above_range/output.css +a { + value: lab(1% 126.25 187.5); + space: lab; + channels: 1% 126.25 187.5 / 1; +} + +<===> +================================================================================ +<===> percent/ab/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% -101% -150%)); + +<===> percent/ab/below_range/output.css +a { + value: lab(1% -126.25 -187.5); + space: lab; + channels: 1% -126.25 -187.5 / 1; +} + +<===> +================================================================================ +<===> percent/lightness/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2% -3%)); + +<===> percent/lightness/in_range/output.css +a { + value: lab(1% 2.5 -3.75); + space: lab; + channels: 1% 2.5 -3.75 / 1; +} + +<===> +================================================================================ +<===> percent/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(110% 2 3)); + +<===> percent/lightness/above_range/output.css +a { + value: lab(100% 2 3); + space: lab; + channels: 100% 2 3 / 1; +} + +<===> +================================================================================ +<===> percent/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(-1% 2 3)); + +<===> percent/lightness/below_range/output.css +a { + value: lab(0% 2 3); + space: lab; + channels: 0% 2 3 / 1; +} + +<===> +================================================================================ +<===> none/lightness/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(none 2 3)); + +<===> none/lightness/output.css +a { + value: lab(none 2 3); + space: lab; + channels: none 2 3 / 1; +} + +<===> +================================================================================ +<===> none/a/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% none 3)); + +<===> none/a/output.css +a { + value: lab(1% none 3); + space: lab; + channels: 1% none 3 / 1; +} + +<===> +================================================================================ +<===> none/b/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 none)); + +<===> none/b/output.css +a { + value: lab(1% 2 none); + space: lab; + channels: 1% 2 none / 1; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab($channels: 1% 2 3)); + +<===> named/output.css +a { + value: lab(1% 2 3); + space: lab; + channels: 1% 2 3 / 1; +} diff --git a/spec/core_functions/color/lab/relative_color.hrx b/spec/core_functions/color/lab/relative_color.hrx new file mode 100644 index 0000000000..771096a218 --- /dev/null +++ b/spec/core_functions/color/lab/relative_color.hrx @@ -0,0 +1,140 @@ +<===> static/alpha/input.scss +a {b: lab(from #aaa l a b / 25%)} + +<===> static/alpha/output.css +a { + b: lab(from #aaa l a b/25%); +} + +<===> +================================================================================ +<===> static/no_alpha/input.scss +a {b: lab(from #aaa l a b)} + +<===> static/no_alpha/output.css +a { + b: lab(from #aaa l a b); +} + +<===> +================================================================================ +<===> calc/alpha/input.scss +a {b: lab(from #aaa calc(l + 0.2) a b / 25%)} + +<===> calc/alpha/output.css +a { + b: lab(from #aaa calc(l + 0.2) a b/25%); +} + +<===> +================================================================================ +<===> calc/no_alpha/input.scss +a {b: lab(from #aaa calc(l + 0.2) a b)} + +<===> calc/no_alpha/output.css +a { + b: lab(from #aaa calc(l + 0.2) a b); +} + +<===> +================================================================================ +<===> var/alpha/input.scss +a {b: lab(from var(--c) l a b / 25%)} + +<===> var/alpha/output.css +a { + b: lab(from var(--c) l a b/25%); +} + +<===> +================================================================================ +<===> var/no_alpha/input.scss +a {b: lab(from var(--c) l a b)} + +<===> var/no_alpha/output.css +a { + b: lab(from var(--c) l a b); +} + +<===> +================================================================================ +<===> different_case/alpha/input.scss +a {b: lab(From #aaa l a b / 25%)} + +<===> different_case/alpha/output.css +a { + b: lab(From #aaa l a b/25%); +} + +<===> +================================================================================ +<===> different_case/no_alpha/input.scss +a {b: lab(From #aaa l a b)} + +<===> different_case/no_alpha/output.css +a { + b: lab(From #aaa l a b); +} + +<===> +================================================================================ +<===> slash_list_alpha/input.scss +@use "sass:list"; +a {b: lab(list.slash(from #aaa r g b, 25%))} + +<===> slash_list_alpha/output.css +a { + b: lab(from #aaa r g b / 25%); +} + +<===> +================================================================================ +<===> error/quoted/alpha/input.scss +a {b: lab("from" #aaa l a b / 25%)} + +<===> error/quoted/alpha/error +Error: $channels: Expected lightness channel to be a number, was "from". + , +1 | a {b: lab("from" #aaa l a b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/quoted/no_alpha/input.scss +a {b: lab("from" #aaa l a b)} + +<===> error/quoted/no_alpha/error +Error: $channels: Expected lightness channel to be a number, was "from". + , +1 | a {b: lab("from" #aaa l a b)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/wrong_keyword/alpha/input.scss +a {b: lab(c #aaa l a b / 25%)} + +<===> error/wrong_keyword/alpha/error +Error: $channels: Expected lightness channel to be a number, was c. + , +1 | a {b: lab(c #aaa l a b / 25%)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/wrong_keyword/no_alpha/input.scss +a {b: lab(c #aaa l a b)} + +<===> error/wrong_keyword/no_alpha/error +Error: $channels: Expected lightness channel to be a number, was c. + , +1 | a {b: lab(c #aaa l a b)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/lab/special_functions/alpha.hrx b/spec/core_functions/color/lab/special_functions/alpha.hrx new file mode 100644 index 0000000000..3ba4fca260 --- /dev/null +++ b/spec/core_functions/color/lab/special_functions/alpha.hrx @@ -0,0 +1,382 @@ +<===> calc/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("calc(1%)") 2 3 / 0.4)); + +<===> calc/string/arg_1/output.css +a { + value: lab(calc(1%) 2 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> calc/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("calc(2)") 3 / 0.4)); + +<===> calc/string/arg_2/output.css +a { + value: lab(1% calc(2) 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> calc/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("calc(3)") / 0.4)); + +<===> calc/string/arg_3/output.css +a { + value: lab(1% 2 calc(3)/0.4); + type: string; +} + +<===> +================================================================================ +<===> calc/string/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / unquote("calc(0.4)"))); + +<===> calc/string/arg_4/output.css +a { + value: lab(1% 2 3/calc(0.4)); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(calc(1px + 1%) 2 3 / 0.4)); + +<===> calc/calculation/arg_1/output.css +a { + value: lab(calc(1px + 1%) 2 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% calc(1px + 1%) 3 / 0.4)); + +<===> calc/calculation/arg_2/output.css +a { + value: lab(1% calc(1px + 1%) 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 calc(1px + 1%) / 0.4)); + +<===> calc/calculation/arg_3/output.css +a { + value: lab(1% 2 calc(1px + 1%)/0.4); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / calc(1px + 1%))); + +<===> calc/calculation/arg_4/output.css +a { + value: lab(1% 2 3/calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/with_slash/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / calc(var(--a) / 2))); + +<===> calc/calculation/with_slash/output.css +a { + value: lab(1% 2 3/calc(var(--a) / 2)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(var(--foo) 2 3 / 0.4)); + +<===> var/arg_1/output.css +a { + value: lab(var(--foo) 2 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> var/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% var(--foo) 3 / 0.4)); + +<===> var/arg_2/output.css +a { + value: lab(1% var(--foo) 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> var/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 var(--foo) / 0.4)); + +<===> var/arg_3/output.css +a { + value: lab(1% 2 var(--foo)/0.4); + type: string; +} + +<===> +================================================================================ +<===> var/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / var(--foo))); + +<===> var/arg_4/output.css +a { + value: lab(1% 2 3/var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> env/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(env(--foo) 2 3 / 0.4)); + +<===> env/arg_1/output.css +a { + value: lab(env(--foo) 2 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> env/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% env(--foo) 3 / 0.4)); + +<===> env/arg_2/output.css +a { + value: lab(1% env(--foo) 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> env/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 env(--foo) / 0.4)); + +<===> env/arg_3/output.css +a { + value: lab(1% 2 env(--foo)/0.4); + type: string; +} + +<===> +================================================================================ +<===> env/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / env(--foo))); + +<===> env/arg_4/output.css +a { + value: lab(1% 2 3/env(--foo)); + type: string; +} + +<===> +================================================================================ +<===> min/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("min(1%)") 2 3 / 0.4)); + +<===> min/string/arg_1/output.css +a { + value: lab(min(1%) 2 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> min/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("min(2)") 3 / 0.4)); + +<===> min/string/arg_2/output.css +a { + value: lab(1% min(2) 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> min/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("min(3)") / 0.4)); + +<===> min/string/arg_3/output.css +a { + value: lab(1% 2 min(3)/0.4); + type: string; +} + +<===> +================================================================================ +<===> min/string/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / unquote("min(0.4)"))); + +<===> min/string/arg_4/output.css +a { + value: lab(1% 2 3/min(0.4)); + type: string; +} + +<===> +================================================================================ +<===> max/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("max(1%)") 2 3 / 0.4)); + +<===> max/string/arg_1/output.css +a { + value: lab(max(1%) 2 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> max/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("max(2)") 3 / 0.4)); + +<===> max/string/arg_2/output.css +a { + value: lab(1% max(2) 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> max/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("max(3)") / 0.4)); + +<===> max/string/arg_3/output.css +a { + value: lab(1% 2 max(3)/0.4); + type: string; +} + +<===> +================================================================================ +<===> max/string/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / unquote("max(0.4)"))); + +<===> max/string/arg_4/output.css +a { + value: lab(1% 2 3/max(0.4)); + type: string; +} + +<===> +================================================================================ +<===> clamp/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("clamp(1%, 2, 3)") 2 3 / 0.4)); + +<===> clamp/string/arg_1/output.css +a { + value: lab(clamp(1%, 2, 3) 2 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> clamp/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("clamp(2, 3, 4)") 3 / 0.4)); + +<===> clamp/string/arg_2/output.css +a { + value: lab(1% clamp(2, 3, 4) 3/0.4); + type: string; +} + +<===> +================================================================================ +<===> clamp/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("clamp(3, 4, 5)") / 0.4)); + +<===> clamp/string/arg_3/output.css +a { + value: lab(1% 2 clamp(3, 4, 5)/0.4); + type: string; +} + +<===> +================================================================================ +<===> clamp/string/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 3 / unquote("clamp(0.4, 0.5, 0.6)"))); + +<===> clamp/string/arg_4/output.css +a { + value: lab(1% 2 3/clamp(0.4, 0.5, 0.6)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_2/input.scss +// var() is substituted before parsing, so it may contain multiple arguments. +@use 'core_functions/color/utils'; +@include utils.inspect(lab(var(--foo) 2 / 0.4)); + +<===> multi_argument_var/1_of_2/output.css +a { + value: lab(var(--foo) 2/0.4); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/2_of_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% var(--foo) / 0.4)); + +<===> multi_argument_var/2_of_2/output.css +a { + value: lab(1% var(--foo)/0.4); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(var(--foo) / 0.4)); + +<===> multi_argument_var/1_of_1/output.css +a { + value: lab(var(--foo)/0.4); + type: string; +} diff --git a/spec/core_functions/color/lab/special_functions/no_alpha.hrx b/spec/core_functions/color/lab/special_functions/no_alpha.hrx new file mode 100644 index 0000000000..8f461e6412 --- /dev/null +++ b/spec/core_functions/color/lab/special_functions/no_alpha.hrx @@ -0,0 +1,280 @@ +<===> calc/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("calc(1%)") 2 3)); + +<===> calc/string/arg_1/output.css +a { + value: lab(calc(1%) 2 3); + type: string; +} + +<===> +================================================================================ +<===> calc/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("calc(2)") 3)); + +<===> calc/string/arg_2/output.css +a { + value: lab(1% calc(2) 3); + type: string; +} + +<===> +================================================================================ +<===> calc/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("calc(3)"))); + +<===> calc/string/arg_3/output.css +a { + value: lab(1% 2 calc(3)); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(calc(1px + 1%) 2 3)); + +<===> calc/calculation/arg_1/output.css +a { + value: lab(calc(1px + 1%) 2 3); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% calc(1px + 1%) 3)); + +<===> calc/calculation/arg_2/output.css +a { + value: lab(1% calc(1px + 1%) 3); + type: string; +} + +<===> +================================================================================ +<===> calc/calculation/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 calc(1px + 1%))); + +<===> calc/calculation/arg_3/output.css +a { + value: lab(1% 2 calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(var(--foo) 2 3)); + +<===> var/arg_1/output.css +a { + value: lab(var(--foo) 2 3); + type: string; +} + +<===> +================================================================================ +<===> var/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% var(--foo) 3)); + +<===> var/arg_2/output.css +a { + value: lab(1% var(--foo) 3); + type: string; +} + +<===> +================================================================================ +<===> var/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 var(--foo))); + +<===> var/arg_3/output.css +a { + value: lab(1% 2 var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> env/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(env(--foo) 2 3)); + +<===> env/arg_1/output.css +a { + value: lab(env(--foo) 2 3); + type: string; +} + +<===> +================================================================================ +<===> env/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% env(--foo) 3)); + +<===> env/arg_2/output.css +a { + value: lab(1% env(--foo) 3); + type: string; +} + +<===> +================================================================================ +<===> env/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 env(--foo))); + +<===> env/arg_3/output.css +a { + value: lab(1% 2 env(--foo)); + type: string; +} + +<===> +================================================================================ +<===> min/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("min(1%)") 2 3)); + +<===> min/string/arg_1/output.css +a { + value: lab(min(1%) 2 3); + type: string; +} + +<===> +================================================================================ +<===> min/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("min(2)") 3)); + +<===> min/string/arg_2/output.css +a { + value: lab(1% min(2) 3); + type: string; +} + +<===> +================================================================================ +<===> min/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("min(3)"))); + +<===> min/string/arg_3/output.css +a { + value: lab(1% 2 min(3)); + type: string; +} + +<===> +================================================================================ +<===> max/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("max(1%)") 2 3)); + +<===> max/string/arg_1/output.css +a { + value: lab(max(1%) 2 3); + type: string; +} + +<===> +================================================================================ +<===> max/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("max(2)") 3)); + +<===> max/string/arg_2/output.css +a { + value: lab(1% max(2) 3); + type: string; +} + +<===> +================================================================================ +<===> max/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("max(3)"))); + +<===> max/string/arg_3/output.css +a { + value: lab(1% 2 max(3)); + type: string; +} + +<===> +================================================================================ +<===> clamp/string/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(unquote("clamp(1%, 2, 3)") 2 3)); + +<===> clamp/string/arg_1/output.css +a { + value: lab(clamp(1%, 2, 3) 2 3); + type: string; +} + +<===> +================================================================================ +<===> clamp/string/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% unquote("clamp(2, 3, 4)") 3)); + +<===> clamp/string/arg_2/output.css +a { + value: lab(1% clamp(2, 3, 4) 3); + type: string; +} + +<===> +================================================================================ +<===> clamp/string/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lab(1% 2 unquote("clamp(3, 4, 5)"))); + +<===> clamp/string/arg_3/output.css +a { + value: lab(1% 2 clamp(3, 4, 5)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_2/input.scss +// var() is substituted before parsing, so it may contain multiple arguments. +a {b: lab(var(--foo) 2)} + +<===> multi_argument_var/1_of_2/output.css +a { + b: lab(var(--foo) 2); +} + +<===> +================================================================================ +<===> multi_argument_var/2_of_2/input.scss +a {b: lab(1% var(--foo))} + +<===> multi_argument_var/2_of_2/output.css +a { + b: lab(1% var(--foo)); +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/input.scss +a {b: lab(var(--foo))} + +<===> multi_argument_var/1_of_1/output.css +a { + b: lab(var(--foo)); +} diff --git a/spec/core_functions/color/lab/special_functions/slash_list.hrx b/spec/core_functions/color/lab/special_functions/slash_list.hrx new file mode 100644 index 0000000000..b3aace0b9c --- /dev/null +++ b/spec/core_functions/color/lab/special_functions/slash_list.hrx @@ -0,0 +1,36 @@ +<===> channels/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(lab(list.slash(var(--foo), 0.4))); + +<===> channels/output.css +a { + value: lab(var(--foo) / 0.4); + type: string; +} + +<===> +================================================================================ +<===> some_channels/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(lab(list.slash(1% var(--foo), 0.4))); + +<===> some_channels/output.css +a { + value: lab(1% var(--foo) / 0.4); + type: string; +} + +<===> +================================================================================ +<===> alpha/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(lab(list.slash(1% 2 3, var(--c)))); + +<===> alpha/output.css +a { + value: lab(1% 2 3 / var(--c)); + type: string; +} diff --git a/spec/core_functions/color/lch/README.md b/spec/core_functions/color/lch/README.md new file mode 100644 index 0000000000..5117c908e1 --- /dev/null +++ b/spec/core_functions/color/lch/README.md @@ -0,0 +1,2 @@ +Some of the same behavior tested for `lab()` applies to this function as well, +but for terseness' sake isn't tested explicitly. diff --git a/spec/core_functions/color/lch/alpha.hrx b/spec/core_functions/color/lch/alpha.hrx new file mode 100644 index 0000000000..d3e730ebf8 --- /dev/null +++ b/spec/core_functions/color/lch/alpha.hrx @@ -0,0 +1,169 @@ +<===> transparent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / 0)); + +<===> transparent/output.css +a { + value: lch(1% 2 3deg / 0); + space: lch; + channels: 1% 2 3deg / 0; +} + +<===> +================================================================================ +<===> opaque/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / 1)); + +<===> opaque/output.css +a { + value: lch(1% 2 3deg); + space: lch; + channels: 1% 2 3deg / 1; +} + +<===> +================================================================================ +<===> partial/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / 0.4)); + +<===> partial/output.css +a { + value: lch(1% 2 3deg / 0.4); + space: lch; + channels: 1% 2 3deg / 0.4; +} + +<===> +================================================================================ +<===> percent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / 40%)); + +<===> percent/output.css +a { + value: lch(1% 2 3deg / 0.4); + space: lch; + channels: 1% 2 3deg / 0.4; +} + +<===> +================================================================================ +<===> degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / calc(infinity))); + +<===> degenerate/positive_infinity/output.css +a { + value: lch(1% 2 3deg); + space: lch; + channels: 1% 2 3deg / 1; +} + +<===> +================================================================================ +<===> degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / calc(-infinity))); + +<===> degenerate/negative_infinity/output.css +a { + value: lch(1% 2 3deg / 0); + space: lch; + channels: 1% 2 3deg / 0; +} + +<===> +================================================================================ +<===> degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / calc(NaN))); + +<===> degenerate/nan/output.css +a { + value: lch(1% 2 3deg / 0); + space: lch; + channels: 1% 2 3deg / 0; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch($channels: 1% 2 3deg / 0.4)); + +<===> named/output.css +a { + value: lch(1% 2 3deg / 0.4); + space: lch; + channels: 1% 2 3deg / 0.4; +} + +<===> +================================================================================ +<===> slash_list/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(lch(list.slash(1% 2 3deg, 0.4))); + +<===> slash_list/output.css +a { + value: lch(1% 2 3deg / 0.4); + space: lch; + channels: 1% 2 3deg / 0.4; +} + +<===> +================================================================================ +<===> none/slash/hue/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 none / 0.4)); + +<===> none/slash/hue/output.css +a { + value: lch(1% 2 none / 0.4); + space: lch; + channels: 1% 2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / none)); + +<===> none/slash/alpha/output.css +a { + value: lch(1% 2 3deg / none); + space: lch; + channels: 1% 2 3deg / none; +} + +<===> +================================================================================ +<===> none/slash_list/hue/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(lch(list.slash(1% 2 none, 0.4))); + +<===> none/slash_list/hue/output.css +a { + value: lch(1% 2 none / 0.4); + space: lch; + channels: 1% 2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash_list/alpha/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(lch(list.slash(1% 2 3deg, none))); + +<===> none/slash_list/alpha/output.css +a { + value: lch(1% 2 3deg / none); + space: lch; + channels: 1% 2 3deg / none; +} diff --git a/spec/core_functions/color/lch/error.hrx b/spec/core_functions/color/lch/error.hrx new file mode 100644 index 0000000000..f79aefbf14 --- /dev/null +++ b/spec/core_functions/color/lch/error.hrx @@ -0,0 +1,272 @@ +<===> unit/lightness/input.scss +a {b: lch(1px 2 3deg)} + +<===> unit/lightness/error +Error: $lightness: Expected 1px to have unit "%" or no units. + , +1 | a {b: lch(1px 2 3deg)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/chroma/input.scss +a {b: lch(1% 2px 3deg)} + +<===> unit/chroma/error +Error: $chroma: Expected 2px to have unit "%" or no units. + , +1 | a {b: lch(1% 2px 3deg)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/hue/unrelated/input.scss +a {b: lch(1% 2 3px)} + +<===> unit/hue/unrelated/error +Error: $hue: Expected 3px to have an angle unit (deg, grad, rad, turn). + , +1 | a {b: lch(1% 2 3px)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/hue/percent/input.scss +a {b: lch(1% 2 3%)} + +<===> unit/hue/percent/error +Error: $hue: Expected 3% to have an angle unit (deg, grad, rad, turn). + , +1 | a {b: lch(1% 2 3%)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash/input.scss +a {b: lch(1% 2 3deg/0.4px)} + +<===> unit/alpha/slash/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +1 | a {b: lch(1% 2 3deg/0.4px)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: lch(list.slash(1% 2 3deg, 0.4px))} + +<===> unit/alpha/slash_list/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +2 | a {b: lch(list.slash(1% 2 3deg, 0.4px))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/lightness/input.scss +a {b: lch(c 2 3deg)} + +<===> type/lightness/error +Error: $channels: Expected lightness channel to be a number, was c. + , +1 | a {b: lch(c 2 3deg)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/chroma/input.scss +a {b: lch(1% c 3deg)} + +<===> type/chroma/error +Error: $channels: Expected chroma channel to be a number, was c. + , +1 | a {b: lch(1% c 3deg)} + | ^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/hue/input.scss +a {b: lch(1% 2 c)} + +<===> type/hue/error +Error: $channels: Expected hue channel to be a number, was c. + , +1 | a {b: lch(1% 2 c)} + | ^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: lch(list.slash(1% 2 3deg, c))} + +<===> type/alpha/slash_list/error +Error: $channels: c is not a number. + , +2 | a {b: lch(list.slash(1% 2 3deg, c))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/bracketed/input.scss +a {b: lch([1% 2 3deg])} + +<===> list/bracketed/error +Error: $channels: Expected an unbracketed list, was [1% 2 3deg] + , +1 | a {b: lch([1% 2 3deg])} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/comma/input.scss +a {b: lch((1%, 2, 3deg))} + +<===> list/comma/error +Error: $channels: Expected a space- or slash-separated list, was (1%, 2, 3deg) + , +1 | a {b: lch((1%, 2, 3deg))} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/three/input.scss +@use 'sass:list'; +a {b: lch(list.slash(1%, 2, 3deg))} + +<===> list/slash/three/error +Error: $channels: Only 2 slash-separated elements allowed, but 3 were passed. + , +2 | a {b: lch(list.slash(1%, 2, 3deg))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/one/input.scss +@use 'sass:list'; +$single-arg-slash-separated: list.append((), 1% 2 3deg, $separator: slash); +a {b: lch($single-arg-slash-separated)} + +<===> list/slash/one/error +Error: $channels: Only 2 slash-separated elements allowed, but 1 was passed. + , +3 | a {b: lch($single-arg-slash-separated)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/empty/input.scss +a {b: lch(())} + +<===> list/empty/error +Error: $channels: Color component list may not be empty. + , +1 | a {b: lch(())} + | ^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/empty_space/input.scss +@use 'sass:list'; +$empty-space: list.join((), (), $separator: space); +a {b: lch(())} + +<===> list/empty_space/error +Error: $channels: Color component list may not be empty. + , +3 | a {b: lch(())} + | ^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/too_few_channels/input.scss +a {b: lch(1% 2)} + +<===> list/too_few_channels/error +Error: $channels: The lch color space has 3 channels but (1% 2) has 2. + , +1 | a {b: lch(1% 2)} + | ^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/too_many_channels/input.scss +a {b: lch(1% 2 3deg 0.4)} + +<===> list/too_many_channels/error +Error: $channels: The lch color space has 3 channels but (1% 2 3deg 0.4) has 4. + , +1 | a {b: lch(1% 2 3deg 0.4)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/input.scss +a {b: lch()} + +<===> too_few_args/error +Error: Missing argument $channels. + ,--> input.scss +1 | a {b: lch()} + | ^^^^^ invocation + ' + ,--> sass:color +1 | @function lch($channels) { + | ============== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +a {b: lch(1%, 2, 3deg, 0.4)} + +<===> too_many_args/error +Error: Only 1 argument allowed, but 4 were passed. + ,--> input.scss +1 | a {b: lch(1%, 2, 3deg, 0.4)} + | ^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function lch($channels) { + | ============== declaration + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/lch/no_alpha.hrx b/spec/core_functions/color/lch/no_alpha.hrx new file mode 100644 index 0000000000..1402f79413 --- /dev/null +++ b/spec/core_functions/color/lch/no_alpha.hrx @@ -0,0 +1,322 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1 2 3deg)); + +<===> unitless/in_range/output.css +a { + value: lch(1% 2 3deg); + space: lch; + channels: 1% 2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(101 2 3deg)); + +<===> unitless/lightness/above_range/output.css +a { + value: lch(100% 2 3deg); + space: lch; + channels: 100% 2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(-1 2 3deg)); + +<===> unitless/lightness/below_range/output.css +a { + value: lch(0% 2 3deg); + space: lch; + channels: 0% 2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(calc(infinity) 2 3deg)); + +<===> unitless/lightness/degenerate/positive_infinity/output.css +a { + value: lch(100% 2 3deg); + space: lch; + channels: 100% 2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(calc(-infinity) 2 3deg)); + +<===> unitless/lightness/degenerate/negative_infinity/output.css +a { + value: lch(0% 2 3deg); + space: lch; + channels: 0% 2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(calc(NaN) 2 3deg)); + +<===> unitless/lightness/degenerate/nan/output.css +a { + value: lch(0% 2 3deg); + space: lch; + channels: 0% 2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 0.5 3deg)); + +<===> unitless/chroma/above_range/output.css +a { + value: lch(1% 0.5 3deg); + space: lch; + channels: 1% 0.5 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% -0.1 3deg)); + +<===> unitless/chroma/below_range/output.css +a { + value: lch(1% 0 3deg); + space: lch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% calc(infinity) 3deg)); + +<===> unitless/chroma/degenerate/positive_infinity/output.css +a { + value: lch(1% calc(infinity) 3deg); + space: lch; + channels: 1% calc(infinity) 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% calc(-infinity) 3deg)); + +<===> unitless/chroma/degenerate/negative_infinity/output.css +a { + value: lch(1% 0 3deg); + space: lch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% calc(NaN) 3deg)); + +<===> unitless/chroma/degenerate/nan/output.css +a { + value: lch(1% 0 3deg); + space: lch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/hue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 361deg)); + +<===> unitless/hue/above_range/output.css +a { + value: lch(1% 2 1deg); + space: lch; + channels: 1% 2 1deg / 1; +} + +<===> +================================================================================ +<===> unitless/hue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 -1deg)); + +<===> unitless/hue/below_range/output.css +a { + value: lch(1% 2 359deg); + space: lch; + channels: 1% 2 359deg / 1; +} + +<===> +================================================================================ +<===> unitless/hue/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 calc(infinity))); + +<===> unitless/hue/degenerate/positive_infinity/output.css +a { + value: lch(1% 2 calc(NaN * 1deg)); + space: lch; + channels: 1% 2 calc(NaN * 1deg) / 1; +} + +<===> +================================================================================ +<===> unitless/hue/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 calc(-infinity))); + +<===> unitless/hue/degenerate/negative_infinity/output.css +a { + value: lch(1% 2 calc(NaN * 1deg)); + space: lch; + channels: 1% 2 calc(NaN * 1deg) / 1; +} + +<===> +================================================================================ +<===> unitless/hue/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 calc(NaN))); + +<===> unitless/hue/degenerate/nan/output.css +a { + value: lch(1% 2 calc(NaN * 1deg)); + space: lch; + channels: 1% 2 calc(NaN * 1deg) / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2% 3deg)); + +<===> percent/in_range/output.css +a { + value: lch(1% 3 3deg); + space: lch; + channels: 1% 3 3deg / 1; +} + +<===> +================================================================================ +<===> percent/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(110% 2 3deg)); + +<===> percent/lightness/above_range/output.css +a { + value: lch(100% 2 3deg); + space: lch; + channels: 100% 2 3deg / 1; +} + +<===> +================================================================================ +<===> percent/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(-1% 2 3deg)); + +<===> percent/lightness/below_range/output.css +a { + value: lch(0% 2 3deg); + space: lch; + channels: 0% 2 3deg / 1; +} + +<===> +================================================================================ +<===> percent/chroma/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 101% 3deg)); + +<===> percent/chroma/above_range/output.css +a { + value: lch(1% 151.5 3deg); + space: lch; + channels: 1% 151.5 3deg / 1; +} + +<===> +================================================================================ +<===> percent/chroma/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% -1% 3deg)); + +<===> percent/chroma/below_range/output.css +a { + value: lch(1% 0 3deg); + space: lch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> none/lightness/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(none 2 3deg)); + +<===> none/lightness/output.css +a { + value: lch(none 2 3deg); + space: lch; + channels: none 2 3deg / 1; +} + +<===> +================================================================================ +<===> none/chroma/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% none 3deg)); + +<===> none/chroma/output.css +a { + value: lch(1% none 3deg); + space: lch; + channels: 1% none 3deg / 1; +} + +<===> +================================================================================ +<===> none/hue/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 none)); + +<===> none/hue/output.css +a { + value: lch(1% 2 none); + space: lch; + channels: 1% 2 none / 1; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch($channels: 1% 2 3deg)); + +<===> named/output.css +a { + value: lch(1% 2 3deg); + space: lch; + channels: 1% 2 3deg / 1; +} diff --git a/spec/core_functions/color/lch/special_functions.hrx b/spec/core_functions/color/lch/special_functions.hrx new file mode 100644 index 0000000000..dc2ff487bf --- /dev/null +++ b/spec/core_functions/color/lch/special_functions.hrx @@ -0,0 +1,142 @@ +<===> calculation/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(calc(1px + 1%) 2 3deg)); + +<===> calculation/arg_1/output.css +a { + value: lch(calc(1px + 1%) 2 3deg); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% calc(1px + 1%) 3deg)); + +<===> calculation/arg_2/output.css +a { + value: lch(1% calc(1px + 1%) 3deg); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 calc(1px + 1%))); + +<===> calculation/arg_3/output.css +a { + value: lch(1% 2 calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / calc(1px + 1%))); + +<===> calculation/arg_4/output.css +a { + value: lch(1% 2 3deg/calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(var(--foo) 2 3deg)); + +<===> var/arg_1/output.css +a { + value: lch(var(--foo) 2 3deg); + type: string; +} + +<===> +================================================================================ +<===> var/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% var(--foo) 3deg)); + +<===> var/arg_2/output.css +a { + value: lch(1% var(--foo) 3deg); + type: string; +} + +<===> +================================================================================ +<===> var/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 var(--foo))); + +<===> var/arg_3/output.css +a { + value: lch(1% 2 var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% 2 3deg / var(--foo))); + +<===> var/arg_4/output.css +a { + value: lch(1% 2 3deg/var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_2/input.scss +// var() is substituted before parsing, so it may contain multiple arguments. +@use 'core_functions/color/utils'; +@include utils.inspect(lch(var(--foo) 2deg)); + +<===> multi_argument_var/1_of_2/output.css +a { + value: lch(var(--foo) 2deg); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/2_of_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(1% var(--foo))); + +<===> multi_argument_var/2_of_2/output.css +a { + value: lch(1% var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/no_alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(var(--foo))); + +<===> multi_argument_var/1_of_1/no_alpha/output.css +a { + value: lch(var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(lch(var(--foo) / 0.4)); + +<===> multi_argument_var/1_of_1/alpha/output.css +a { + value: lch(var(--foo)/0.4); + type: string; +} diff --git a/spec/core_functions/color/lighten.hrx b/spec/core_functions/color/lighten.hrx new file mode 100644 index 0000000000..39d882a390 --- /dev/null +++ b/spec/core_functions/color/lighten.hrx @@ -0,0 +1,263 @@ +<===> max/input.scss +a {b: lighten(red, 100%)} + +<===> max/output.css +a { + b: white; +} + +<===> max/warning +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 100%) +color.adjust($color, $lightness: 100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten(red, 100%)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> max_remaining/input.scss +a {b: lighten(red, 50%)} + +<===> max_remaining/output.css +a { + b: white; +} + +<===> max_remaining/warning +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 100%) +color.adjust($color, $lightness: 50%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten(red, 50%)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> min/input.scss +a {b: lighten(red, 0%)} + +<===> min/output.css +a { + b: red; +} + +<===> min/warning +DEPRECATION WARNING: lighten() is deprecated. Suggestion: + +color.adjust($color, $lightness: 0%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten(red, 0%)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> middle/input.scss +a {b: lighten(red, 14%)} + +<===> middle/output.css +a { + b: rgb(255, 71.4, 71.4); +} + +<===> middle/warning +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 28%) +color.adjust($color, $lightness: 14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten(red, 14%)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> fraction/input.scss +a {b: lighten(red, 0.5%)} + +<===> fraction/output.css +a { + b: rgb(255, 2.55, 2.55); +} + +<===> fraction/warning +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 1%) +color.adjust($color, $lightness: 0.5%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten(red, 0.5%)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/input.scss +a {b: lighten(rgba(red, 0.4), 100%)} + +<===> alpha/output.css +a { + b: rgba(255, 255, 255, 0.4); +} + +<===> alpha/warning +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 100%) +color.adjust($color, $lightness: 100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten(rgba(red, 0.4), 100%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +a {b: lighten($color: red, $amount: 14%)} + +<===> named/output.css +a { + b: rgb(255, 71.4, 71.4); +} + +<===> named/warning +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 28%) +color.adjust($color, $lightness: 14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten($color: red, $amount: 14%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_few_args/input.scss +a {b: lighten(red)} + +<===> error/too_few_args/error +Error: Missing argument $amount. + ,--> input.scss +1 | a {b: lighten(red)} + | ^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function lighten($color, $amount) { + | ======================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: lighten(red, 1%, 2)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +1 | a {b: lighten(red, 1%, 2)} + | ^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function lighten($color, $amount) { + | ======================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color/input.scss +a {b: lighten(1, 2)} + +<===> error/type/color/error +Error: $color: 1 is not a color. + , +1 | a {b: lighten(1, 2)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/type/lightness/input.scss +a {b: lighten(red, blue)} + +<===> error/type/lightness/error +Error: $amount: blue is not a number. + , +1 | a {b: lighten(red, blue)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_low/input.scss +a {b: lighten(red, -0.001)} + +<===> error/bounds/too_low/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: lighten(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/bounds/too_high/input.scss +a {b: lighten(red, 100.001)} + +<===> error/bounds/too_high/error +Error: $amount: Expected 100.001 to be within 0 and 100. + , +1 | a {b: lighten(red, 100.001)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +a {b: lighten(color(srgb 0 0 0), 10%)} + +<===> error/non_legacy/error +Error: lighten() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument. + , +1 | a {b: lighten(color(srgb 0 0 0), 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/lightness.hrx b/spec/core_functions/color/lightness.hrx index a56f66e61b..c319618deb 100644 --- a/spec/core_functions/color/lightness.hrx +++ b/spec/core_functions/color/lightness.hrx @@ -7,6 +7,19 @@ a { b: 100%; } +<===> max/warning +DEPRECATION WARNING: color.lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.lightness(hsl(0, 100%, 100%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss @@ -18,6 +31,19 @@ a { b: 0%; } +<===> min/warning +DEPRECATION WARNING: color.lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.lightness(hsl(0, 100%, 0%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/input.scss @@ -29,6 +55,19 @@ a { b: 50%; } +<===> middle/warning +DEPRECATION WARNING: color.lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.lightness(hsl(0, 100%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> fraction/input.scss @@ -40,6 +79,19 @@ a { b: 0.5%; } +<===> fraction/warning +DEPRECATION WARNING: color.lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.lightness(hsl(0, 100%, 0.5%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss @@ -51,6 +103,19 @@ a { b: 42%; } +<===> named/warning +DEPRECATION WARNING: color.lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.lightness($color: hsl(0, 100%, 42%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -100,3 +165,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.lightness(lch(0% 0 0deg))} + +<===> error/non_legacy/error +Error: color.lightness() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.lightness(lch(0% 0 0deg))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/mix.hrx b/spec/core_functions/color/mix.hrx deleted file mode 100644 index d52ad609ed..0000000000 --- a/spec/core_functions/color/mix.hrx +++ /dev/null @@ -1,388 +0,0 @@ -<===> unweighted/min_and_max/input.scss -@use "sass:color"; -// Each channel becomes the average of 255 and 0, which is 128 = 0xAA. -a {b: color.mix(#ff00ff, #00ff00)} - -<===> unweighted/min_and_max/output.css -a { - b: gray; -} - -<===> -================================================================================ -<===> unweighted/identical/input.scss -@use "sass:color"; -// If two channels have the same values, they should be the same in the output. -a {b: color.mix(#123456, #123456)} - -<===> unweighted/identical/output.css -a { - b: #123456; -} - -<===> -================================================================================ -<===> unweighted/average/input.scss -@use "sass:color"; -// All channels should be averaged across the two colors. -a {b: color.mix(#91e16f, #0144bf)} - -<===> unweighted/average/output.css -a { - b: #499397; -} - -<===> -================================================================================ -<===> explicit_weight/even/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, #0144bf, 50%)} - -<===> explicit_weight/even/output.css -a { - b: #499397; -} - -<===> -================================================================================ -<===> explicit_weight/first/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, #0144bf, 100%)} - -<===> explicit_weight/first/output.css -a { - b: #91e16f; -} - -<===> -================================================================================ -<===> explicit_weight/last/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, #0144bf, 0%)} - -<===> explicit_weight/last/output.css -a { - b: #0144bf; -} - -<===> -================================================================================ -<===> explicit_weight/firstwards/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, #0144bf, 92%)} - -<===> explicit_weight/firstwards/output.css -a { - b: #85d475; -} - -<===> -================================================================================ -<===> explicit_weight/lastwards/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, #0144bf, 43%)} - -<===> explicit_weight/lastwards/output.css -a { - b: #3f889d; -} - -<===> -================================================================================ -<===> alpha/even/input.scss -@use "sass:color"; -a {b: color.mix(rgba(#91e16f, 0.3), rgba(#0144bf, 0.3))} - -<===> alpha/even/output.css -a { - b: rgba(73, 147, 151, 0.3); -} - -<===> -================================================================================ -<===> alpha/first/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, transparent)} - -<===> alpha/first/output.css -a { - b: rgba(145, 225, 111, 0.5); -} - -<===> -================================================================================ -<===> alpha/last/input.scss -@use "sass:color"; -a {b: color.mix(transparent, #0144bf)} - -<===> alpha/last/output.css -a { - b: rgba(1, 68, 191, 0.5); -} - -<===> -================================================================================ -<===> alpha/firstwards/input.scss -@use "sass:color"; -a {b: color.mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3))} - -<===> alpha/firstwards/output.css -a { - b: rgba(109, 186, 131, 0.55); -} - -<===> -================================================================================ -<===> alpha/lastwards/input.scss -@use "sass:color"; -a {b: color.mix(rgba(#91e16f, 0.4), rgba(#0144bf, 0.9))} - -<===> alpha/lastwards/output.css -a { - b: rgba(37, 107, 171, 0.65); -} - -<===> -================================================================================ -<===> both_weights/transparent/first/input.scss -@use "sass:color"; -a {b: color.mix(transparent, #0144bf, 70%)} - -<===> both_weights/transparent/first/output.css -a { - b: rgba(1, 68, 191, 0.3); -} - -<===> -================================================================================ -<===> both_weights/transparent/last/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, transparent, 70%)} - -<===> both_weights/transparent/last/output.css -a { - b: rgba(145, 225, 111, 0.7); -} - -<===> -================================================================================ -<===> both_weights/weighted/first/input.scss -@use "sass:color"; -a {b: color.mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 100%)} - -<===> both_weights/weighted/first/output.css -a { - b: rgba(145, 225, 111, 0.2); -} - -<===> -================================================================================ -<===> both_weights/weighted/last/input.scss -@use "sass:color"; -a {b: color.mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 0%)} - -<===> both_weights/weighted/last/output.css -a { - b: rgba(1, 68, 191, 0.7); -} - -<===> -================================================================================ -<===> both_weights/mixed/firstwards/input.scss -@use "sass:color"; -a {b: color.mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3), 63%)} - -<===> both_weights/mixed/firstwards/output.css -a { - b: rgba(121, 199, 124, 0.615); -} - -<===> -================================================================================ -<===> both_weights/mixed/lastwards/input.scss -@use "sass:color"; -a {b: color.mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 42%)} - -<===> both_weights/mixed/lastwards/output.css -a { - b: rgba(29, 99, 175, 0.49); -} - -<===> -================================================================================ -<===> both_weights/contradiction/input.scss -@use "sass:color"; -// When we weight entirely towards a transparent color, the formula for -// computing the combined alpha would divide by zero, so we just return -// transparent as a special case. -a {b: color.mix(transparent, #0144bf, 100%)} - -<===> both_weights/contradiction/output.css -a { - b: rgba(0, 0, 0, 0); -} - -<===> -================================================================================ -<===> named/input.scss -@use "sass:color"; -a {b: color.mix($color1: #91e16f, $color2: #0144bf, $weight: 92%)} - -<===> named/output.css -a { - b: #85d475; -} - -<===> -================================================================================ -<===> units/weight/unitless/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, #0144bf, 50)} - -<===> units/weight/unitless/output.css -a { - b: #499397; -} - -<===> units/weight/unitless/warning -DEPRECATION WARNING: $weight: Passing a number without unit % (50) is deprecated. - -To preserve current behavior: $weight * 1% - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.mix(#91e16f, #0144bf, 50)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> units/weight/unknown/input.scss -@use "sass:color"; -a {b: color.mix(#91e16f, #0144bf, 50px)} - -<===> units/weight/unknown/output.css -a { - b: #499397; -} - -<===> units/weight/unknown/warning -DEPRECATION WARNING: $weight: Passing a number without unit % (50px) is deprecated. - -To preserve current behavior: calc($weight / 1px * 1%) - -More info: https://sass-lang.com/d/function-units - - , -2 | a {b: color.mix(#91e16f, #0144bf, 50px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -@use "sass:color"; -a {b: color.mix(red, blue, 100, 1)} - -<===> error/too_many_args/error -Error: Only 3 arguments allowed, but 4 were passed. - ,--> input.scss -2 | a {b: color.mix(red, blue, 100, 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function mix($color1, $color2, $weight: 50%) { - | =================================== declaration - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/too_few_args/input.scss -@use "sass:color"; -a {b: color.mix(red)} - -<===> error/too_few_args/error -Error: Missing argument $color2. - ,--> input.scss -2 | a {b: color.mix(red)} - | ^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function mix($color1, $color2, $weight: 50%) { - | =================================== declaration - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color1/input.scss -@use "sass:color"; -a {b: color.mix(1, blue)} - -<===> error/type/color1/error -Error: $color1: 1 is not a color. - , -2 | a {b: color.mix(1, blue)} - | ^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color2/input.scss -@use "sass:color"; -a {b: color.mix(red, 1)} - -<===> error/type/color2/error -Error: $color2: 1 is not a color. - , -2 | a {b: color.mix(red, 1)} - | ^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/type/weight/input.scss -@use "sass:color"; -a {b: color.mix(red, blue, green)} - -<===> error/type/weight/error -Error: $weight: green is not a number. - , -2 | a {b: color.mix(red, blue, green)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_low/input.scss -@use "sass:color"; -a {b: color.mix(red, blue, -0.001%)} - -<===> error/bounds/too_low/error -Error: $weight: Expected -0.001% to be within 0% and 100%. - , -2 | a {b: color.mix(red, blue, -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_high/input.scss -@use "sass:color"; -a {b: color.mix(red, blue, 100.001%)} - -<===> error/bounds/too_high/error -Error: $weight: Expected 100.001% to be within 0% and 100%. - , -2 | a {b: color.mix(red, blue, 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/mix/alpha.hrx b/spec/core_functions/color/mix/alpha.hrx new file mode 100644 index 0000000000..0f63657175 --- /dev/null +++ b/spec/core_functions/color/mix/alpha.hrx @@ -0,0 +1,47 @@ +<===> even/input.scss +a {b: mix(rgba(#91e16f, 0.3), rgba(#0144bf, 0.3))} + +<===> even/output.css +a { + b: rgba(73, 146.5, 151, 0.3); +} + +<===> +================================================================================ +<===> first/input.scss +a {b: mix(#91e16f, transparent)} + +<===> first/output.css +a { + b: rgba(145, 225, 111, 0.5); +} + +<===> +================================================================================ +<===> last/input.scss +a {b: mix(transparent, #0144bf)} + +<===> last/output.css +a { + b: rgba(1, 68, 191, 0.5); +} + +<===> +================================================================================ +<===> firstwards/input.scss +a {b: mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3))} + +<===> firstwards/output.css +a { + b: rgba(109, 185.75, 131, 0.55); +} + +<===> +================================================================================ +<===> lastwards/input.scss +a {b: mix(rgba(#91e16f, 0.4), rgba(#0144bf, 0.9))} + +<===> lastwards/output.css +a { + b: rgba(37, 107.25, 171, 0.65); +} diff --git a/spec/core_functions/color/mix/both_weights.hrx b/spec/core_functions/color/mix/both_weights.hrx new file mode 100644 index 0000000000..bb90bd43c4 --- /dev/null +++ b/spec/core_functions/color/mix/both_weights.hrx @@ -0,0 +1,70 @@ +<===> transparent/first/input.scss +a {b: mix(transparent, #0144bf, 70%)} + +<===> transparent/first/output.css +a { + b: rgba(1, 68, 191, 0.3); +} + +<===> +================================================================================ +<===> transparent/last/input.scss +a {b: mix(#91e16f, transparent, 70%)} + +<===> transparent/last/output.css +a { + b: rgba(145, 225, 111, 0.7); +} + +<===> +================================================================================ +<===> weighted/first/input.scss +a {b: mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 100%)} + +<===> weighted/first/output.css +a { + b: rgba(145, 225, 111, 0.2); +} + +<===> +================================================================================ +<===> weighted/last/input.scss +a {b: mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 0%)} + +<===> weighted/last/output.css +a { + b: rgba(1, 68, 191, 0.7); +} + +<===> +================================================================================ +<===> mixed/firstwards/input.scss +a {b: mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3), 63%)} + +<===> mixed/firstwards/output.css +a { + b: rgba(121.4247787611, 199.296460177, 124.0973451327, 0.615); +} + +<===> +================================================================================ +<===> mixed/lastwards/input.scss +a {b: mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 42%)} + +<===> mixed/lastwards/output.css +a { + b: rgba(29, 98.5277777778, 175.4444444444, 0.49); +} + +<===> +================================================================================ +<===> contradiction/input.scss +// When we weight entirely towards a transparent color, the formula for +// computing the combined alpha would divide by zero, so we just return +// transparent as a special case. +a {b: mix(transparent, #0144bf, 100%)} + +<===> contradiction/output.css +a { + b: rgba(0, 0, 0, 0); +} diff --git a/spec/core_functions/color/mix/error.hrx b/spec/core_functions/color/mix/error.hrx new file mode 100644 index 0000000000..cf5b481d4f --- /dev/null +++ b/spec/core_functions/color/mix/error.hrx @@ -0,0 +1,293 @@ +<===> too_many_args/input.scss +a {b: mix(red, blue, 30%, lch, 1)} + +<===> too_many_args/error +Error: Only 4 arguments allowed, but 5 were passed. + ,--> input.scss +1 | a {b: mix(red, blue, 30%, lch, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function mix($color1, $color2, $weight: 50%, $method: null) { + | ================================================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/input.scss +a {b: mix(red)} + +<===> too_few_args/error +Error: Missing argument $color2. + ,--> input.scss +1 | a {b: mix(red)} + | ^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function mix($color1, $color2, $weight: 50%, $method: null) { + | ================================================== declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> null_method/non_legacy/color1/input.scss +a {b: mix(lch(20% -20 0), red)} + +<===> null_method/non_legacy/color1/error +Error: $color1: To use color.mix() with non-legacy color lch(20% 0 0deg), you must provide a $method. + , +1 | a {b: mix(lch(20% -20 0), red)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> null_method/non_legacy/color2/input.scss +a {b: mix(red, lch(20% -20 0))} + +<===> null_method/non_legacy/color2/error +Error: $color2: To use color.mix() with non-legacy color lch(20% 0 0deg), you must provide a $method. + , +1 | a {b: mix(red, lch(20% -20 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> color_interpolation_method/input.scss +a {b: mix(red, blue, $method: brighter)} + +<===> color_interpolation_method/error +Error: $method: Unknown color space "brighter". + , +1 | a {b: mix(red, blue, $method: brighter)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> interpolation/number/input.scss +a {b: mix(red, blue, $method: hsl 1)} + +<===> interpolation/number/error +Error: $method: 1 is not a string. + , +1 | a {b: mix(red, blue, $method: hsl 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> interpolation_list/separator/input.scss +a {b: mix(red, blue, $method: hsl, longer hue)} + +<===> interpolation_list/separator/error +Error: Positional arguments must come before keyword arguments. + , +1 | a {b: mix(red, blue, $method: hsl, longer hue)} + | ^^^^^^^^^^ + ' + input.scss 1:36 root stylesheet + +<===> +================================================================================ +<===> interpolation_list/slash/input.scss +a {b: mix(red, blue, $method: hsl/longer/hue)} + +<===> interpolation_list/slash/error +Error: $method: Unknown color space "hsl/longer/hue". + , +1 | a {b: mix(red, blue, $method: hsl/longer/hue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> interpolation_list/quoted/input.scss +a {b: mix(red, blue, $method: "hsl longer hue")} + +<===> interpolation_list/quoted/error +Error: $method: Expected "hsl longer hue" to be an unquoted string. + , +1 | a {b: mix(red, blue, $method: "hsl longer hue")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> invalid_method/wrong_hue_keyword/input.scss +a {b: mix(red, blue, $method: hsl longer shade)} + +<===> invalid_method/wrong_hue_keyword/error +Error: $method: Expected unquoted string "hue" at the end of (hsl longer shade), was shade. + , +1 | a {b: mix(red, blue, $method: hsl longer shade)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> invalid_method/unsupported/input.scss +// "specified" was a method in an earlier draft of CSS Colors 4, but it was +// dropped because it required implementations to lazily normalize hues. +a {b: mix(red, blue, $method: hsl specified hue)} + +<===> invalid_method/unsupported/error +Error: $method: Unknown hue interpolation method specified. + , +3 | a {b: mix(red, blue, $method: hsl specified hue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> extra_character_end/input.scss +a {b: mix(red, blue, $method: hsl longer hue.)} + +<===> extra_character_end/error +Error: Expected identifier. + , +1 | a {b: mix(red, blue, $method: hsl longer hue.)} + | ^ + ' + input.scss 1:46 root stylesheet + +<===> +================================================================================ +<===> extra_character_start/input.scss +a {b: mix(red, blue, $method: ,hsl longer hue)} + +<===> extra_character_start/error +Error: Expected expression. + , +1 | a {b: mix(red, blue, $method: ,hsl longer hue)} + | ^ + ' + input.scss 1:31 root stylesheet + +<===> +================================================================================ +<===> unknown_interpolation/input.scss +a {b: mix(red, blue, $method: lch longerhue)} + +<===> unknown_interpolation/error +Error: $method: Unknown hue interpolation method longerhue. + , +1 | a {b: mix(red, blue, $method: lch longerhue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> rectangular_space_with_method/input.scss +a {b: mix(red, blue, $method: srgb longer hue)} + +<===> rectangular_space_with_method/error +Error: $method: Hue interpolation method "HueInterpolationMethod.longer hue" may not be set for rectangular color space srgb. + , +1 | a {b: mix(red, blue, $method: srgb longer hue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> missing_hue_string/input.scss +a {b: mix(red, blue, $method: lch decreasing)} + +<===> missing_hue_string/error +Error: $method: Expected unquoted string "hue" after (lch decreasing). + , +1 | a {b: mix(red, blue, $method: lch decreasing)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> parentheses/input.scss +a {b: mix(red, blue, $method: lch (decreasing hue))} + +<===> parentheses/error +Error: $method: (decreasing hue) is not a string. + , +1 | a {b: mix(red, blue, $method: lch (decreasing hue))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/color1/input.scss +a {b: mix(1, blue)} + +<===> type/color1/error +Error: $color1: 1 is not a color. + , +1 | a {b: mix(1, blue)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/color2/input.scss +a {b: mix(red, 1)} + +<===> type/color2/error +Error: $color2: 1 is not a color. + , +1 | a {b: mix(red, 1)} + | ^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/weight/input.scss +a {b: mix(red, blue, green)} + +<===> type/weight/error +Error: $weight: green is not a number. + , +1 | a {b: mix(red, blue, green)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> bounds/too_low/input.scss +a {b: mix(red, blue, -0.001%)} + +<===> bounds/too_low/error +Error: $weight: Expected -0.001% to be within 0% and 100%. + , +1 | a {b: mix(red, blue, -0.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> bounds/too_high/input.scss +a {b: mix(red, blue, 100.001%)} + +<===> bounds/too_high/error +Error: $weight: Expected 100.001% to be within 0% and 100%. + , +1 | a {b: mix(red, blue, 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/mix/explicit_method.hrx b/spec/core_functions/color/mix/explicit_method.hrx new file mode 100644 index 0000000000..cd40772c79 --- /dev/null +++ b/spec/core_functions/color/mix/explicit_method.hrx @@ -0,0 +1,39 @@ +<===> srgb/input.scss +a {b: mix(red, green, $method: xyz)} + +<===> srgb/output.css +a { + b: rgb(187.5160306784, 92.3735312967, 0); +} + +<===> +================================================================================ +<===> non_srgb/input.scss +a {b: mix(lab(54.3 80.8 69.9), lch(46.3 68 134), $method: oklch)} + +<===> non_srgb/output.css +a { + b: lab(50.3820989016% 23.739480318 159.7498257827); +} + +<===> +================================================================================ +<===> previously_invalid/input.scss +// An earlier draft of CSS Colors 4 didn't allow some spaces because they were +// redundant with others, but they should be allowed now. +a {b: mix(lab(54.3 80.8 69.9), lch(46.3 68 134), $method: display-p3)} + +<===> previously_invalid/output.css +a { + b: lab(43.9078099681% 26.0060363023 48.9943374049); +} + +<===> +================================================================================ +<===> weighted/input.scss +a {b: mix(lab(54.3 80.8 69.9), lch(46.3 68 134), 30%, oklch)} + +<===> weighted/output.css +a { + b: lab(48.946809662% -7.9262399011 131.5295913021); +} diff --git a/spec/core_functions/color/mix/explicit_weight.hrx b/spec/core_functions/color/mix/explicit_weight.hrx new file mode 100644 index 0000000000..32e49e2ca9 --- /dev/null +++ b/spec/core_functions/color/mix/explicit_weight.hrx @@ -0,0 +1,47 @@ +<===> even/input.scss +a {b: mix(#91e16f, #0144bf, 50%)} + +<===> even/output.css +a { + b: rgb(73, 146.5, 151); +} + +<===> +================================================================================ +<===> first/input.scss +a {b: mix(#91e16f, #0144bf, 100%)} + +<===> first/output.css +a { + b: #91e16f; +} + +<===> +================================================================================ +<===> last/input.scss +a {b: mix(#91e16f, #0144bf, 0%)} + +<===> last/output.css +a { + b: #0144bf; +} + +<===> +================================================================================ +<===> firstwards/input.scss +a {b: mix(#91e16f, #0144bf, 92%)} + +<===> firstwards/output.css +a { + b: rgb(133.48, 212.44, 117.4); +} + +<===> +================================================================================ +<===> lastwards/input.scss +a {b: mix(#91e16f, #0144bf, 43%)} + +<===> lastwards/output.css +a { + b: rgb(62.92, 135.51, 156.6); +} diff --git a/spec/core_functions/color/mix/hue_interpolation.hrx b/spec/core_functions/color/mix/hue_interpolation.hrx new file mode 100644 index 0000000000..1b5b55bdb7 --- /dev/null +++ b/spec/core_functions/color/mix/hue_interpolation.hrx @@ -0,0 +1,107 @@ +<===> default/acute/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 190), $method: oklch)} + +<===> default/acute/output.css +a { + b: oklch(50% 0.1 110deg); +} + +<===> +================================================================================ +<===> default/obtuse/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 230), $method: oklch)} + +<===> default/obtuse/output.css +a { + b: oklch(50% 0.1 310deg); +} + +<===> +================================================================================ +<===> shorter/acute/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 190), $method: oklch shorter hue)} + +<===> shorter/acute/output.css +a { + b: oklch(50% 0.1 110deg); +} + +<===> +================================================================================ +<===> shorter/obtuse/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 230), $method: oklch shorter hue)} + +<===> shorter/obtuse/output.css +a { + b: oklch(50% 0.1 310deg); +} + +<===> +================================================================================ +<===> longer/obtuse/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 230), $method: oklch longer hue)} + +<===> longer/obtuse/output.css +a { + b: oklch(50% 0.1 130deg); +} + +<===> +================================================================================ +<===> increasing/acute/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 190), $method: oklch increasing hue)} + +<===> increasing/acute/output.css +a { + b: oklch(50% 0.1 110deg); +} + +<===> +================================================================================ +<===> increasing/obtuse/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 230), $method: oklch increasing hue)} + +<===> increasing/obtuse/output.css +a { + b: oklch(50% 0.1 130deg); +} + +<===> +================================================================================ +<===> decreasing/acute/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 190), $method: oklch decreasing hue)} + +<===> decreasing/acute/output.css +a { + b: oklch(50% 0.1 290deg); +} + +<===> +================================================================================ +<===> decreasing/obtuse/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 230), $method: oklch decreasing hue)} + +<===> decreasing/obtuse/output.css +a { + b: oklch(50% 0.1 310deg); +} + +<===> +================================================================================ +<===> weighted/input.scss +a {b: mix(red, green, 20%, lch longer hue)} + +<===> weighted/output.css +a { + b: rgb(201.9125152451, 62.5456438786, 25.0531427989); +} + +<===> +================================================================================ +<===> case_insensitive/input.scss +a {b: mix(oklch(0.5 0.1 30), oklch(0.5 0.1 190), $method: oKlCh LONger HUE)} + +<===> case_insensitive/output.css +a { + b: oklch(50% 0.1 290deg); +} diff --git a/spec/core_functions/color/mix/missing.hrx b/spec/core_functions/color/mix/missing.hrx new file mode 100644 index 0000000000..553e43e4cf --- /dev/null +++ b/spec/core_functions/color/mix/missing.hrx @@ -0,0 +1,231 @@ +<===> explicit/same/legacy/color1/input.scss +@use "sass:color"; +a {b: color.mix(rgb(none 100 200), rgb(200 100 0), $method: rgb)} + +<===> explicit/same/legacy/color1/output.css +a { + b: #c86464; +} + +<===> +================================================================================ +<===> explicit/same/legacy/color2/input.scss +@use "sass:color"; +a {b: color.mix(rgb(0 100 200), rgb(200 none 0), $method: rgb)} + +<===> explicit/same/legacy/color2/output.css +a { + b: #646464; +} + +<===> +================================================================================ +<===> explicit/same/legacy/both/input.scss +@use "sass:color"; +a {b: color.mix(rgb(0 none 200), rgb(200 none 0), $method: rgb)} + +<===> explicit/same/legacy/both/output.css +a { + b: rgb(100 none 100); +} + +<===> +================================================================================ +<===> explicit/same/modern/color1/input.scss +@use "sass:color"; +a { + b: color.mix( + color(srgb none 0.1 0.2), + color(srgb 0.1 0.2 0.3), + $method: srgb + ); +} + +<===> explicit/same/modern/color1/output.css +a { + b: color(srgb 0.1 0.15 0.25); +} + +<===> +================================================================================ +<===> explicit/same/modern/color2/input.scss +@use "sass:color"; +a { + b: color.mix( + color(srgb 0.1 0.2 0.3), + color(srgb 0.1 none 0.2), + $method: srgb + ); +} + +<===> explicit/same/modern/color2/output.css +a { + b: color(srgb 0.1 0.2 0.25); +} + +<===> +================================================================================ +<===> explicit/same/modern/both/input.scss +@use "sass:color"; +a { + b: color.mix( + color(srgb 0.1 0.2 none), + color(srgb 0.3 0.2 none), + $method: srgb + ); +} + +<===> explicit/same/modern/both/output.css +a { + b: color(srgb 0.2 0.2 none); +} + +<===> +================================================================================ +<===> explicit/analogous/legacy/color1/input.scss +@use "sass:color"; +a {b: color.mix(rgb(none 100 200), rgb(200 100 0), $method: rec2020)} + +<===> explicit/analogous/legacy/color1/output.css +a { + b: rgb(199.7671172587, 91.8239078594, 117.7284104313); +} + +<===> +================================================================================ +<===> explicit/analogous/legacy/color2/input.scss +@use "sass:color"; +a {b: color.mix(rgb(0 100 200), rgb(200 none 0), $method: rec2020)} + +<===> explicit/analogous/legacy/color2/output.css +a { + b: rgb(128.6114294932, 95.678836923, 112.8090426091); +} + +<===> +================================================================================ +<===> explicit/analogous/legacy/both/input.scss +@use "sass:color"; +a {b: color.mix(rgb(0 none 200), rgb(200 none 0), $method: rec2020)} + +<===> explicit/analogous/legacy/both/output.css +a { + b: rgb(129.0248146672, 0, 115.9531222724); +} + +<===> +================================================================================ +<===> explicit/analogous/modern/color1/input.scss +@use "sass:color"; +a { + b: color.mix( + color(srgb none 0.1 0.2), + color(srgb 0.1 0.2 0.3), + $method: rec2020 + ); +} + +<===> explicit/analogous/modern/color1/output.css +a { + b: color(srgb 0.146201736 0.1492595622 0.2497768167); +} + +<===> +================================================================================ +<===> explicit/analogous/modern/color2/input.scss +@use "sass:color"; +a { + b: color.mix( + color(srgb 0.1 0.2 0.3), + color(srgb 0.1 none 0.2), + $method: rec2020 + ); +} + +<===> explicit/analogous/modern/color2/output.css +a { + b: color(srgb 0.0134568276 0.2030946777 0.2456679982); +} + +<===> +================================================================================ +<===> explicit/analogous/modern/both/input.scss +@use "sass:color"; +a { + b: color.mix( + color(srgb 0.1 0.2 none), + color(srgb 0.3 0.2 none), + $method: rec2020 + ); +} + +<===> explicit/analogous/modern/both/output.css +a { + b: color(srgb 0.2110804397 0.2012136757 none); +} + +<===> +================================================================================ +<===> powerless/legacy/color1/input.scss +@use "sass:color"; +a {b: color.mix(hsl(0deg 0% 30%), hsl(120deg 50% 50%), $method: lch)} + +<===> powerless/legacy/color1/output.css +a { + b: hsl(113.4583259264, 28.061366187%, 40.5877359835%); +} + +<===> +================================================================================ +<===> powerless/legacy/color2/input.scss +@use "sass:color"; +a {b: color.mix(hsl(120deg 50% 50%), hsl(0deg 0% 30%), $method: lch)} + +<===> powerless/legacy/color2/output.css +a { + b: hsl(113.4583259264, 28.061366187%, 40.5877359835%); +} + +<===> +================================================================================ +<===> powerless/legacy/both/input.scss +@use "sass:color"; +a {b: color.mix(hsl(120deg 0% 50%), hsl(0deg 0% 30%), $method: lch)} + +<===> powerless/legacy/both/output.css +a { + b: hsl(0, 0%, 39.7779408276%); +} + +<===> +================================================================================ +<===> powerless/modern/color1/input.scss +@use "sass:color"; +a {b: color.mix(lch(30% 0% 0deg), lch(50% 10% 120deg), $method: hsl)} + +<===> powerless/modern/color1/output.css +a { + b: lch(39.8551054023% 6.455971398 120.4338354849deg); +} + +<===> +================================================================================ +<===> powerless/modern/color2/input.scss +@use "sass:color"; +a {b: color.mix(lch(50% 10% 120deg), lch(30% 0% 0deg), $method: hsl)} + +<===> powerless/modern/color2/output.css +a { + b: lch(39.8551054023% 6.455971398 120.4338354849deg); +} + +<===> +================================================================================ +<===> powerless/modern/both/input.scss +@use "sass:color"; +a {b: color.mix(lch(50% 0% 120deg), lch(30% 0% 0deg), $method: hsl)} + +<===> powerless/modern/both/output.css +a { + b: lch(40.2238896861% 0 none); +} diff --git a/spec/core_functions/color/mix/mixed_spaces.hrx b/spec/core_functions/color/mix/mixed_spaces.hrx new file mode 100644 index 0000000000..e26fa61dc1 --- /dev/null +++ b/spec/core_functions/color/mix/mixed_spaces.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: mix(hsl(0 100% 50%), green, $method: lch)} + +<===> output.css +a { + b: hsl(50.9351301875, 199.2813015981%, 19.0269267557%); +} diff --git a/spec/core_functions/color/mix/named.hrx b/spec/core_functions/color/mix/named.hrx new file mode 100644 index 0000000000..9cd36a77bf --- /dev/null +++ b/spec/core_functions/color/mix/named.hrx @@ -0,0 +1,17 @@ +<===> polar_space/input.scss +a {b: mix($color1: #91e16f, $color2: #0144bf, $weight: 92%, $method: hsl decreasing hue)} + +<===> polar_space/output.css +a { + b: rgb(177.749777646, 225.4953896552, 98.9846103448); +} + +<===> +================================================================================ +<===> rectangular_space/input.scss +a {b: mix($color1: #91e16f, $color2: #0144bf, $weight: 92%, $method: lab)} + +<===> rectangular_space/output.css +a { + b: rgb(141.3483384924, 211.5499489073, 120.4340844852); +} diff --git a/spec/core_functions/color/mix/predefined.hrx b/spec/core_functions/color/mix/predefined.hrx new file mode 100644 index 0000000000..504ea9ba73 --- /dev/null +++ b/spec/core_functions/color/mix/predefined.hrx @@ -0,0 +1,37 @@ +<===> rgb/input.scss +a {b: mix(color(display-p3 1 0 0), color(display-p3 0 1 0), 20%, oklch)} + +<===> rgb/output.css +a { + b: color(display-p3 0.6684751745 0.8535262883 -0.4281891831); +} + +<===> +================================================================================ +<===> rgb_explicit_method/input.scss +a {b: mix(color(display-p3 1 0 0), color(display-p3 0 1 0), 60%, $method: hsl)} + +<===> rgb_explicit_method/output.css +a { + b: color(display-p3 1.0849635599 0.8595336595 -0.252822726); +} + +<===> +================================================================================ +<===> xyz/input.scss +a {b: mix(color(xyz 0.15 0.24 0), color(xyz 1 .2 0), 65%, lch)} + +<===> xyz/output.css +a { + b: color(xyz 0.2607187352 0.230899759 -0.0359437687); +} + +<===> +================================================================================ +<===> xyz_explicit_method/input.scss +a {b: mix(color(xyz-d50 0.15 0.24 0), color(xyz-d65 1 .2 0), $method: hwb)} + +<===> xyz_explicit_method/output.css +a { + b: color(xyz-d50 0.5250037958 0.2975068714 -0.1396614468); +} diff --git a/spec/core_functions/color/mix/units.hrx b/spec/core_functions/color/mix/units.hrx new file mode 100644 index 0000000000..c4c2e1e0d0 --- /dev/null +++ b/spec/core_functions/color/mix/units.hrx @@ -0,0 +1,43 @@ +<===> weight/unitless/input.scss +a {b: mix(#91e16f, #0144bf, 50)} + +<===> weight/unitless/output.css +a { + b: rgb(73, 146.5, 151); +} + +<===> weight/unitless/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (50) is deprecated. + +To preserve current behavior: $weight * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: mix(#91e16f, #0144bf, 50)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> weight/unknown/input.scss +a {b: mix(#91e16f, #0144bf, 50px)} + +<===> weight/unknown/output.css +a { + b: rgb(73, 146.5, 151); +} + +<===> weight/unknown/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (50px) is deprecated. + +To preserve current behavior: calc($weight / 1px * 1%) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: mix(#91e16f, #0144bf, 50px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/mix/unweighted.hrx b/spec/core_functions/color/mix/unweighted.hrx new file mode 100644 index 0000000000..6794e918d3 --- /dev/null +++ b/spec/core_functions/color/mix/unweighted.hrx @@ -0,0 +1,30 @@ +<===> min_and_max/input.scss +// Each channel becomes the average of 255 and 0, which is 128 = 0xAA. +a {b: mix(#ff00ff, #00ff00)} + +<===> min_and_max/output.css +a { + b: rgb(127.5, 127.5, 127.5); +} + +<===> +================================================================================ +<===> identical/input.scss +// If two channels have the same values, they should be the same in the output. +a {b: mix(#123456, #123456)} + +<===> identical/output.css +a { + b: #123456; +} + +<===> +================================================================================ +<===> average/input.scss +// All channels should be averaged across the two colors. +a {b: mix(#91e16f, #0144bf)} + +<===> average/output.css +a { + b: rgb(73, 146.5, 151); +} diff --git a/spec/core_functions/color/oklab/README.md b/spec/core_functions/color/oklab/README.md new file mode 100644 index 0000000000..5117c908e1 --- /dev/null +++ b/spec/core_functions/color/oklab/README.md @@ -0,0 +1,2 @@ +Some of the same behavior tested for `lab()` applies to this function as well, +but for terseness' sake isn't tested explicitly. diff --git a/spec/core_functions/color/oklab/alpha.hrx b/spec/core_functions/color/oklab/alpha.hrx new file mode 100644 index 0000000000..9addc41b23 --- /dev/null +++ b/spec/core_functions/color/oklab/alpha.hrx @@ -0,0 +1,194 @@ +<===> transparent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(0 255 127 / 0)); + +<===> transparent/output.css +a { + value: oklab(0% 255 127 / 0); + space: oklab; + channels: 0% 255 127 / 0; +} + +<===> +================================================================================ +<===> opaque/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 3 / 1)); + +<===> opaque/output.css +a { + value: oklab(1% 2 3); + space: oklab; + channels: 1% 2 3 / 1; +} + +<===> +================================================================================ +<===> partial/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 3 / 0.4)); + +<===> partial/output.css +a { + value: oklab(1% 2 3 / 0.4); + space: oklab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> percent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 3 / 40%)); + +<===> percent/output.css +a { + value: oklab(1% 2 3 / 0.4); + space: oklab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 -3 / calc(infinity))); + +<===> degenerate/positive_infinity/output.css +a { + value: oklab(1% 2 -3); + space: oklab; + channels: 1% 2 -3 / 1; +} + +<===> +================================================================================ +<===> degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 -3 / calc(-infinity))); + +<===> degenerate/negative_infinity/output.css +a { + value: oklab(1% 2 -3 / 0); + space: oklab; + channels: 1% 2 -3 / 0; +} + +<===> +================================================================================ +<===> degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 -3 / calc(NaN))); + +<===> degenerate/nan/output.css +a { + value: oklab(1% 2 -3 / 0); + space: oklab; + channels: 1% 2 -3 / 0; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab($channels: 1% 2 3 / 0.4)); + +<===> named/output.css +a { + value: oklab(1% 2 3 / 0.4); + space: oklab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> slash_list/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(list.slash(1% 2 3, 0.4))); + +<===> slash_list/output.css +a { + value: oklab(1% 2 3 / 0.4); + space: oklab; + channels: 1% 2 3 / 0.4; +} + +<===> +================================================================================ +<===> none/slash/b/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 none / 0.4)); + +<===> none/slash/b/output.css +a { + value: oklab(1% 2 none / 0.4); + space: oklab; + channels: 1% 2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 3 / none)); + +<===> none/slash/alpha/output.css +a { + value: oklab(1% 2 3 / none); + space: oklab; + channels: 1% 2 3 / none; +} + +<===> +================================================================================ +<===> none/slash_list/b/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(list.slash(1% 2 none, 0.4))); + +<===> none/slash_list/b/output.css +a { + value: oklab(1% 2 none / 0.4); + space: oklab; + channels: 1% 2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash_list/alpha/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(list.slash(1% 2 3, none))); + +<===> none/slash_list/alpha/output.css +a { + value: oklab(1% 2 3 / none); + space: oklab; + channels: 1% 2 3 / none; +} + +<===> +================================================================================ +<===> relative_color/slash/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(from #aaa l a b / 25%)); + +<===> relative_color/slash/output.css +a { + value: oklab(from #aaa l a b/25%); + type: string; +} + +<===> +================================================================================ +<===> relative_color/slash_list/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(list.slash(from #aaa l a b, 25%))); + +<===> relative_color/slash_list/output.css +a { + value: oklab(from #aaa l a b / 25%); + type: string; +} diff --git a/spec/core_functions/color/oklab/error.hrx b/spec/core_functions/color/oklab/error.hrx new file mode 100644 index 0000000000..b39e25c0d2 --- /dev/null +++ b/spec/core_functions/color/oklab/error.hrx @@ -0,0 +1,259 @@ +<===> unit/lightness/input.scss +a {b: oklab(1px 2 3)} + +<===> unit/lightness/error +Error: $lightness: Expected 1px to have unit "%" or no units. + , +1 | a {b: oklab(1px 2 3)} + | ^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/a/input.scss +a {b: oklab(1% 2px 3)} + +<===> unit/a/error +Error: $a: Expected 2px to have unit "%" or no units. + , +1 | a {b: oklab(1% 2px 3)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/b/input.scss +a {b: oklab(1% 2 3px)} + +<===> unit/b/error +Error: $b: Expected 3px to have unit "%" or no units. + , +1 | a {b: oklab(1% 2 3px)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash/input.scss +a {b: oklab(1% 2 3/0.4px)} + +<===> unit/alpha/slash/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +1 | a {b: oklab(1% 2 3/0.4px)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: oklab(list.slash(1% 2 3, 0.4px))} + +<===> unit/alpha/slash_list/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +2 | a {b: oklab(list.slash(1% 2 3, 0.4px))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/lightness/input.scss +a {b: oklab(c 2 3)} + +<===> type/lightness/error +Error: $channels: Expected lightness channel to be a number, was c. + , +1 | a {b: oklab(c 2 3)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/a/input.scss +a {b: oklab(1% c 3)} + +<===> type/a/error +Error: $channels: Expected a channel to be a number, was c. + , +1 | a {b: oklab(1% c 3)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/b/input.scss +a {b: oklab(1% 2 c)} + +<===> type/b/error +Error: $channels: Expected b channel to be a number, was c. + , +1 | a {b: oklab(1% 2 c)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: oklab(list.slash(1% 2 3, c))} + +<===> type/alpha/slash_list/error +Error: $channels: c is not a number. + , +2 | a {b: oklab(list.slash(1% 2 3, c))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/bracketed/input.scss +a {b: oklab([1% 2 3])} + +<===> list/bracketed/error +Error: $channels: Expected an unbracketed list, was [1% 2 3] + , +1 | a {b: oklab([1% 2 3])} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/comma/input.scss +a {b: oklab((1%, 2, 3))} + +<===> list/comma/error +Error: $channels: Expected a space- or slash-separated list, was (1%, 2, 3) + , +1 | a {b: oklab((1%, 2, 3))} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/three/input.scss +@use 'sass:list'; +a {b: oklab(list.slash(1%, 2, 3))} + +<===> list/slash/three/error +Error: $channels: Only 2 slash-separated elements allowed, but 3 were passed. + , +2 | a {b: oklab(list.slash(1%, 2, 3))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/one/input.scss +@use 'sass:list'; +$single-arg-slash-separated: list.append((), 1% 2 3, $separator: slash); +a {b: oklab($single-arg-slash-separated)} + +<===> list/slash/one/error +Error: $channels: Only 2 slash-separated elements allowed, but 1 was passed. + , +3 | a {b: oklab($single-arg-slash-separated)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/empty/input.scss +a {b: oklab(())} + +<===> list/empty/error +Error: $channels: Color component list may not be empty. + , +1 | a {b: oklab(())} + | ^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/empty_space/input.scss +@use 'sass:list'; +$empty-space: list.join((), (), $separator: space); +a {b: oklab(())} + +<===> list/empty_space/error +Error: $channels: Color component list may not be empty. + , +3 | a {b: oklab(())} + | ^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/too_few_channels/input.scss +a {b: oklab(1% 2)} + +<===> list/too_few_channels/error +Error: $channels: The oklab color space has 3 channels but (1% 2) has 2. + , +1 | a {b: oklab(1% 2)} + | ^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/too_many_channels/input.scss +a {b: oklab(1% 2 3 0.4)} + +<===> list/too_many_channels/error +Error: $channels: The oklab color space has 3 channels but (1% 2 3 0.4) has 4. + , +1 | a {b: oklab(1% 2 3 0.4)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/input.scss +a {b: oklab()} + +<===> too_few_args/error +Error: Missing argument $channels. + ,--> input.scss +1 | a {b: oklab()} + | ^^^^^^^ invocation + ' + ,--> sass:color +1 | @function oklab($channels) { + | ================ declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +a {b: oklab(1%, 2, 3, 0.4)} + +<===> too_many_args/error +Error: Only 1 argument allowed, but 4 were passed. + ,--> input.scss +1 | a {b: oklab(1%, 2, 3, 0.4)} + | ^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function oklab($channels) { + | ================ declaration + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/oklab/no_alpha.hrx b/spec/core_functions/color/oklab/no_alpha.hrx new file mode 100644 index 0000000000..cc39abb303 --- /dev/null +++ b/spec/core_functions/color/oklab/no_alpha.hrx @@ -0,0 +1,334 @@ +<===> unitless/ab/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 -3)); + +<===> unitless/ab/in_range/output.css +a { + value: oklab(1% 2 -3); + space: oklab; + channels: 1% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/ab/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 126 300)); + +<===> unitless/ab/above_range/output.css +a { + value: oklab(1% 126 300); + space: oklab; + channels: 1% 126 300 / 1; +} + +<===> +================================================================================ +<===> unitless/ab/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% -126 -300)); + +<===> unitless/ab/below_range/output.css +a { + value: oklab(1% -126 -300); + space: oklab; + channels: 1% -126 -300 / 1; +} + +<===> +================================================================================ +<===> unitless/a/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% calc(infinity) -300)); + +<===> unitless/a/degenerate/positive_infinity/output.css +a { + value: oklab(1% calc(infinity) -300); + space: oklab; + channels: 1% calc(infinity) -300 / 1; +} + +<===> +================================================================================ +<===> unitless/a/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% calc(-infinity) -300)); + +<===> unitless/a/degenerate/negative_infinity/output.css +a { + value: oklab(1% calc(-infinity) -300); + space: oklab; + channels: 1% calc(-infinity) -300 / 1; +} + +<===> +================================================================================ +<===> unitless/a/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% calc(NaN) -300)); + +<===> unitless/a/degenerate/nan/output.css +a { + value: oklab(1% calc(NaN) -300); + space: oklab; + channels: 1% calc(NaN) -300 / 1; +} + +<===> +================================================================================ +<===> unitless/b/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 calc(infinity))); + +<===> unitless/b/degenerate/positive_infinity/output.css +a { + value: oklab(1% 2 calc(infinity)); + space: oklab; + channels: 1% 2 calc(infinity) / 1; +} + +<===> +================================================================================ +<===> unitless/b/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 calc(-infinity))); + +<===> unitless/b/degenerate/negative_infinity/output.css +a { + value: oklab(1% 2 calc(-infinity)); + space: oklab; + channels: 1% 2 calc(-infinity) / 1; +} + +<===> +================================================================================ +<===> unitless/b/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 calc(NaN))); + +<===> unitless/b/degenerate/nan/output.css +a { + value: oklab(1% 2 calc(NaN)); + space: oklab; + channels: 1% 2 calc(NaN) / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(0.1 2 -3)); + +<===> unitless/lightness/in_range/output.css +a { + value: oklab(10% 2 -3); + space: oklab; + channels: 10% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1.1 2 3)); + +<===> unitless/lightness/above_range/output.css +a { + value: oklab(100% 2 3); + space: oklab; + channels: 100% 2 3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(-0.1 2 3)); + +<===> unitless/lightness/below_range/output.css +a { + value: oklab(0% 2 3); + space: oklab; + channels: 0% 2 3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(calc(infinity) 2 -3)); + +<===> unitless/lightness/degenerate/positive_infinity/output.css +a { + value: oklab(100% 2 -3); + space: oklab; + channels: 100% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(calc(-infinity) 2 -3)); + +<===> unitless/lightness/degenerate/negative_infinity/output.css +a { + value: oklab(0% 2 -3); + space: oklab; + channels: 0% 2 -3 / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(calc(NaN) 2 -3)); + +<===> unitless/lightness/degenerate/nan/output.css +a { + value: oklab(0% 2 -3); + space: oklab; + channels: 0% 2 -3 / 1; +} + +<===> +================================================================================ +<===> percent/ab/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2% -3%)); + +<===> percent/ab/in_range/output.css +a { + value: oklab(1% 0.008 -0.012); + space: oklab; + channels: 1% 0.008 -0.012 / 1; +} + +<===> +================================================================================ +<===> percent/ab/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 101% 150%)); + +<===> percent/ab/above_range/output.css +a { + value: oklab(1% 0.404 0.6); + space: oklab; + channels: 1% 0.404 0.6 / 1; +} + +<===> +================================================================================ +<===> percent/ab/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% -101% -150%)); + +<===> percent/ab/below_range/output.css +a { + value: oklab(1% -0.404 -0.6); + space: oklab; + channels: 1% -0.404 -0.6 / 1; +} + +<===> +================================================================================ +<===> percent/lightness/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2% -3%)); + +<===> percent/lightness/in_range/output.css +a { + value: oklab(1% 0.008 -0.012); + space: oklab; + channels: 1% 0.008 -0.012 / 1; +} + +<===> +================================================================================ +<===> percent/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(110% 2 3)); + +<===> percent/lightness/above_range/output.css +a { + value: oklab(100% 2 3); + space: oklab; + channels: 100% 2 3 / 1; +} + +<===> +================================================================================ +<===> percent/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(-1% 2 3)); + +<===> percent/lightness/below_range/output.css +a { + value: oklab(0% 2 3); + space: oklab; + channels: 0% 2 3 / 1; +} + +<===> +================================================================================ +<===> none/lightness/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(none 2 3)); + +<===> none/lightness/output.css +a { + value: oklab(none 2 3); + space: oklab; + channels: none 2 3 / 1; +} + +<===> +================================================================================ +<===> none/a/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% none 3)); + +<===> none/a/output.css +a { + value: oklab(1% none 3); + space: oklab; + channels: 1% none 3 / 1; +} + +<===> +================================================================================ +<===> none/b/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 none)); + +<===> none/b/output.css +a { + value: oklab(1% 2 none); + space: oklab; + channels: 1% 2 none / 1; +} + +<===> +================================================================================ +<===> relative_color/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(from #aaa l a b)); + +<===> relative_color/output.css +a { + value: oklab(from #aaa l a b); + type: string; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab($channels: 1% 2 3)); + +<===> named/output.css +a { + value: oklab(1% 2 3); + space: oklab; + channels: 1% 2 3 / 1; +} diff --git a/spec/core_functions/color/oklab/special_functions.hrx b/spec/core_functions/color/oklab/special_functions.hrx new file mode 100644 index 0000000000..16f4e4ebe9 --- /dev/null +++ b/spec/core_functions/color/oklab/special_functions.hrx @@ -0,0 +1,142 @@ +<===> calculation/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(calc(1px + 1%) 2 3)); + +<===> calculation/arg_1/output.css +a { + value: oklab(calc(1px + 1%) 2 3); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% calc(1px + 1%) 3)); + +<===> calculation/arg_2/output.css +a { + value: oklab(1% calc(1px + 1%) 3); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 calc(1px + 1%))); + +<===> calculation/arg_3/output.css +a { + value: oklab(1% 2 calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 3 / calc(1px + 1%))); + +<===> calculation/arg_4/output.css +a { + value: oklab(1% 2 3/calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(var(--foo) 2 3)); + +<===> var/arg_1/output.css +a { + value: oklab(var(--foo) 2 3); + type: string; +} + +<===> +================================================================================ +<===> var/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% var(--foo) 3)); + +<===> var/arg_2/output.css +a { + value: oklab(1% var(--foo) 3); + type: string; +} + +<===> +================================================================================ +<===> var/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 var(--foo))); + +<===> var/arg_3/output.css +a { + value: oklab(1% 2 var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% 2 3 / var(--foo))); + +<===> var/arg_4/output.css +a { + value: oklab(1% 2 3/var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_2/input.scss +// var() is substituted before parsing, so it may contain multiple arguments. +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(var(--foo) 2)); + +<===> multi_argument_var/1_of_2/output.css +a { + value: oklab(var(--foo) 2); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/2_of_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(1% var(--foo))); + +<===> multi_argument_var/2_of_2/output.css +a { + value: oklab(1% var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/no_alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(var(--foo))); + +<===> multi_argument_var/1_of_1/no_alpha/output.css +a { + value: oklab(var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklab(var(--foo) / 0.4)); + +<===> multi_argument_var/1_of_1/alpha/output.css +a { + value: oklab(var(--foo)/0.4); + type: string; +} diff --git a/spec/core_functions/color/oklch/README.md b/spec/core_functions/color/oklch/README.md new file mode 100644 index 0000000000..5117c908e1 --- /dev/null +++ b/spec/core_functions/color/oklch/README.md @@ -0,0 +1,2 @@ +Some of the same behavior tested for `lab()` applies to this function as well, +but for terseness' sake isn't tested explicitly. diff --git a/spec/core_functions/color/oklch/alpha.hrx b/spec/core_functions/color/oklch/alpha.hrx new file mode 100644 index 0000000000..7209e0ab8c --- /dev/null +++ b/spec/core_functions/color/oklch/alpha.hrx @@ -0,0 +1,169 @@ +<===> transparent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / 0)); + +<===> transparent/output.css +a { + value: oklch(1% 0.2 3deg / 0); + space: oklch; + channels: 1% 0.2 3deg / 0; +} + +<===> +================================================================================ +<===> opaque/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / 1)); + +<===> opaque/output.css +a { + value: oklch(1% 0.2 3deg); + space: oklch; + channels: 1% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> partial/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / 0.4)); + +<===> partial/output.css +a { + value: oklch(1% 0.2 3deg / 0.4); + space: oklch; + channels: 1% 0.2 3deg / 0.4; +} + +<===> +================================================================================ +<===> percent/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / 40%)); + +<===> percent/output.css +a { + value: oklch(1% 0.2 3deg / 0.4); + space: oklch; + channels: 1% 0.2 3deg / 0.4; +} + +<===> +================================================================================ +<===> degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / calc(infinity))); + +<===> degenerate/positive_infinity/output.css +a { + value: oklch(1% 0.2 3deg); + space: oklch; + channels: 1% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / calc(-infinity))); + +<===> degenerate/negative_infinity/output.css +a { + value: oklch(1% 0.2 3deg / 0); + space: oklch; + channels: 1% 0.2 3deg / 0; +} + +<===> +================================================================================ +<===> degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / calc(NaN))); + +<===> degenerate/nan/output.css +a { + value: oklch(1% 0.2 3deg / 0); + space: oklch; + channels: 1% 0.2 3deg / 0; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch($channels: 1% 0.2 3deg / 0.4)); + +<===> named/output.css +a { + value: oklch(1% 0.2 3deg / 0.4); + space: oklch; + channels: 1% 0.2 3deg / 0.4; +} + +<===> +================================================================================ +<===> slash_list/input.scss +@use "sass:list"; +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(list.slash(1% 0.2 3deg, 0.4))); + +<===> slash_list/output.css +a { + value: oklch(1% 0.2 3deg / 0.4); + space: oklch; + channels: 1% 0.2 3deg / 0.4; +} + +<===> +================================================================================ +<===> none/slash/hue/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 none / 0.4)); + +<===> none/slash/hue/output.css +a { + value: oklch(1% 0.2 none / 0.4); + space: oklch; + channels: 1% 0.2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / none)); + +<===> none/slash/alpha/output.css +a { + value: oklch(1% 0.2 3deg / none); + space: oklch; + channels: 1% 0.2 3deg / none; +} + +<===> +================================================================================ +<===> none/slash_list/hue/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(list.slash(1% 0.2 none, 0.4))); + +<===> none/slash_list/hue/output.css +a { + value: oklch(1% 0.2 none / 0.4); + space: oklch; + channels: 1% 0.2 none / 0.4; +} + +<===> +================================================================================ +<===> none/slash_list/alpha/input.scss +@use 'sass:list'; +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(list.slash(1% 0.2 3deg, none))); + +<===> none/slash_list/alpha/output.css +a { + value: oklch(1% 0.2 3deg / none); + space: oklch; + channels: 1% 0.2 3deg / none; +} diff --git a/spec/core_functions/color/oklch/error.hrx b/spec/core_functions/color/oklch/error.hrx new file mode 100644 index 0000000000..b71803e340 --- /dev/null +++ b/spec/core_functions/color/oklch/error.hrx @@ -0,0 +1,272 @@ +<===> unit/lightness/input.scss +a {b: oklch(1px 0.2 3deg)} + +<===> unit/lightness/error +Error: $lightness: Expected 1px to have unit "%" or no units. + , +1 | a {b: oklch(1px 0.2 3deg)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/chroma/input.scss +a {b: oklch(1% 2px 3deg)} + +<===> unit/chroma/error +Error: $chroma: Expected 2px to have unit "%" or no units. + , +1 | a {b: oklch(1% 2px 3deg)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/hue/unrelated/input.scss +a {b: oklch(1% 0.2 3px)} + +<===> unit/hue/unrelated/error +Error: $hue: Expected 3px to have an angle unit (deg, grad, rad, turn). + , +1 | a {b: oklch(1% 0.2 3px)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/hue/percent/input.scss +a {b: oklch(1% 0.2 3%)} + +<===> unit/hue/percent/error +Error: $hue: Expected 3% to have an angle unit (deg, grad, rad, turn). + , +1 | a {b: oklch(1% 0.2 3%)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash/input.scss +a {b: oklch(1% 0.2 3deg/0.4px)} + +<===> unit/alpha/slash/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +1 | a {b: oklch(1% 0.2 3deg/0.4px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> unit/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: oklch(list.slash(1% 0.2 3deg, 0.4px))} + +<===> unit/alpha/slash_list/error +Error: $alpha: Expected 0.4px to have unit "%" or no units. + , +2 | a {b: oklch(list.slash(1% 0.2 3deg, 0.4px))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/lightness/input.scss +a {b: oklch(c 0.2 3deg)} + +<===> type/lightness/error +Error: $channels: Expected lightness channel to be a number, was c. + , +1 | a {b: oklch(c 0.2 3deg)} + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/chroma/input.scss +a {b: oklch(1% c 3deg)} + +<===> type/chroma/error +Error: $channels: Expected chroma channel to be a number, was c. + , +1 | a {b: oklch(1% c 3deg)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/hue/input.scss +a {b: oklch(1% 0.2 c)} + +<===> type/hue/error +Error: $channels: Expected hue channel to be a number, was c. + , +1 | a {b: oklch(1% 0.2 c)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> type/alpha/slash_list/input.scss +@use 'sass:list'; +a {b: oklch(list.slash(1% 0.2 3deg, c))} + +<===> type/alpha/slash_list/error +Error: $channels: c is not a number. + , +2 | a {b: oklch(list.slash(1% 0.2 3deg, c))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/bracketed/input.scss +a {b: oklch([1% 0.2 3deg])} + +<===> list/bracketed/error +Error: $channels: Expected an unbracketed list, was [1% 0.2 3deg] + , +1 | a {b: oklch([1% 0.2 3deg])} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/comma/input.scss +a {b: oklch((1%, 2, 3deg))} + +<===> list/comma/error +Error: $channels: Expected a space- or slash-separated list, was (1%, 2, 3deg) + , +1 | a {b: oklch((1%, 2, 3deg))} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/three/input.scss +@use 'sass:list'; +a {b: oklch(list.slash(1%, 2, 3deg))} + +<===> list/slash/three/error +Error: $channels: Only 2 slash-separated elements allowed, but 3 were passed. + , +2 | a {b: oklch(list.slash(1%, 2, 3deg))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> list/slash/one/input.scss +@use 'sass:list'; +$single-arg-slash-separated: list.append((), 1% 0.2 3deg, $separator: slash); +a {b: oklch($single-arg-slash-separated)} + +<===> list/slash/one/error +Error: $channels: Only 2 slash-separated elements allowed, but 1 was passed. + , +3 | a {b: oklch($single-arg-slash-separated)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/empty/input.scss +a {b: oklch(())} + +<===> list/empty/error +Error: $channels: Color component list may not be empty. + , +1 | a {b: oklch(())} + | ^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/empty_space/input.scss +@use 'sass:list'; +$empty-space: list.join((), (), $separator: space); +a {b: oklch(())} + +<===> list/empty_space/error +Error: $channels: Color component list may not be empty. + , +3 | a {b: oklch(())} + | ^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + +<===> +================================================================================ +<===> list/too_few_channels/input.scss +a {b: oklch(1% 2)} + +<===> list/too_few_channels/error +Error: $channels: The oklch color space has 3 channels but (1% 2) has 2. + , +1 | a {b: oklch(1% 2)} + | ^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> list/too_many_channels/input.scss +a {b: oklch(1% 0.2 3deg 0.4)} + +<===> list/too_many_channels/error +Error: $channels: The oklch color space has 3 channels but (1% 0.2 3deg 0.4) has 4. + , +1 | a {b: oklch(1% 0.2 3deg 0.4)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/input.scss +a {b: oklch()} + +<===> too_few_args/error +Error: Missing argument $channels. + ,--> input.scss +1 | a {b: oklch()} + | ^^^^^^^ invocation + ' + ,--> sass:color +1 | @function oklch($channels) { + | ================ declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +a {b: oklch(1%, 2, 3deg, 0.4)} + +<===> too_many_args/error +Error: Only 1 argument allowed, but 4 were passed. + ,--> input.scss +1 | a {b: oklch(1%, 2, 3deg, 0.4)} + | ^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function oklch($channels) { + | ================ declaration + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/oklch/no_alpha.hrx b/spec/core_functions/color/oklch/no_alpha.hrx new file mode 100644 index 0000000000..851b8f73eb --- /dev/null +++ b/spec/core_functions/color/oklch/no_alpha.hrx @@ -0,0 +1,322 @@ +<===> unitless/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(0.1 0.2 3deg)); + +<===> unitless/in_range/output.css +a { + value: oklch(10% 0.2 3deg); + space: oklch; + channels: 10% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1.1 0.2 3deg)); + +<===> unitless/lightness/above_range/output.css +a { + value: oklch(100% 0.2 3deg); + space: oklch; + channels: 100% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(-0.1 0.2 3deg)); + +<===> unitless/lightness/below_range/output.css +a { + value: oklch(0% 0.2 3deg); + space: oklch; + channels: 0% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(calc(infinity) 0.2 3deg)); + +<===> unitless/lightness/degenerate/positive_infinity/output.css +a { + value: oklch(100% 0.2 3deg); + space: oklch; + channels: 100% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(calc(-infinity) 0.2 3deg)); + +<===> unitless/lightness/degenerate/negative_infinity/output.css +a { + value: oklch(0% 0.2 3deg); + space: oklch; + channels: 0% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/lightness/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(calc(NaN) 0.2 3deg)); + +<===> unitless/lightness/degenerate/nan/output.css +a { + value: oklch(0% 0.2 3deg); + space: oklch; + channels: 0% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.5 3deg)); + +<===> unitless/chroma/above_range/output.css +a { + value: oklch(1% 0.5 3deg); + space: oklch; + channels: 1% 0.5 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% -0.1 3deg)); + +<===> unitless/chroma/below_range/output.css +a { + value: oklch(1% 0 3deg); + space: oklch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% calc(infinity) 3deg)); + +<===> unitless/chroma/degenerate/positive_infinity/output.css +a { + value: oklch(1% calc(infinity) 3deg); + space: oklch; + channels: 1% calc(infinity) 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% calc(-infinity) 3deg)); + +<===> unitless/chroma/degenerate/negative_infinity/output.css +a { + value: oklch(1% 0 3deg); + space: oklch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/chroma/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% calc(NaN) 3deg)); + +<===> unitless/chroma/degenerate/nan/output.css +a { + value: oklch(1% 0 3deg); + space: oklch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> unitless/hue/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 361deg)); + +<===> unitless/hue/above_range/output.css +a { + value: oklch(1% 0.2 1deg); + space: oklch; + channels: 1% 0.2 1deg / 1; +} + +<===> +================================================================================ +<===> unitless/hue/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 -1deg)); + +<===> unitless/hue/below_range/output.css +a { + value: oklch(1% 0.2 359deg); + space: oklch; + channels: 1% 0.2 359deg / 1; +} + +<===> +================================================================================ +<===> unitless/hue/degenerate/positive_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 2 calc(infinity))); + +<===> unitless/hue/degenerate/positive_infinity/output.css +a { + value: oklch(1% 2 calc(NaN * 1deg)); + space: oklch; + channels: 1% 2 calc(NaN * 1deg) / 1; +} + +<===> +================================================================================ +<===> unitless/hue/degenerate/negative_infinity/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 2 calc(-infinity))); + +<===> unitless/hue/degenerate/negative_infinity/output.css +a { + value: oklch(1% 2 calc(NaN * 1deg)); + space: oklch; + channels: 1% 2 calc(NaN * 1deg) / 1; +} + +<===> +================================================================================ +<===> unitless/hue/degenerate/nan/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 2 calc(NaN))); + +<===> unitless/hue/degenerate/nan/output.css +a { + value: oklch(1% 2 calc(NaN * 1deg)); + space: oklch; + channels: 1% 2 calc(NaN * 1deg) / 1; +} + +<===> +================================================================================ +<===> percent/in_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 2% 3deg)); + +<===> percent/in_range/output.css +a { + value: oklch(1% 0.008 3deg); + space: oklch; + channels: 1% 0.008 3deg / 1; +} + +<===> +================================================================================ +<===> percent/lightness/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(110% 0.2 3deg)); + +<===> percent/lightness/above_range/output.css +a { + value: oklch(100% 0.2 3deg); + space: oklch; + channels: 100% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> percent/lightness/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(-1% 0.2 3deg)); + +<===> percent/lightness/below_range/output.css +a { + value: oklch(0% 0.2 3deg); + space: oklch; + channels: 0% 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> percent/chroma/above_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 101% 3deg)); + +<===> percent/chroma/above_range/output.css +a { + value: oklch(1% 0.404 3deg); + space: oklch; + channels: 1% 0.404 3deg / 1; +} + +<===> +================================================================================ +<===> percent/chroma/below_range/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% -1% 3deg)); + +<===> percent/chroma/below_range/output.css +a { + value: oklch(1% 0 3deg); + space: oklch; + channels: 1% 0 3deg / 1; +} + +<===> +================================================================================ +<===> none/lightness/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(none 0.2 3deg)); + +<===> none/lightness/output.css +a { + value: oklch(none 0.2 3deg); + space: oklch; + channels: none 0.2 3deg / 1; +} + +<===> +================================================================================ +<===> none/chroma/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% none 3deg)); + +<===> none/chroma/output.css +a { + value: oklch(1% none 3deg); + space: oklch; + channels: 1% none 3deg / 1; +} + +<===> +================================================================================ +<===> none/hue/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 none)); + +<===> none/hue/output.css +a { + value: oklch(1% 0.2 none); + space: oklch; + channels: 1% 0.2 none / 1; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch($channels: 1% 0.2 3deg)); + +<===> named/output.css +a { + value: oklch(1% 0.2 3deg); + space: oklch; + channels: 1% 0.2 3deg / 1; +} diff --git a/spec/core_functions/color/oklch/special_functions.hrx b/spec/core_functions/color/oklch/special_functions.hrx new file mode 100644 index 0000000000..60100e9e30 --- /dev/null +++ b/spec/core_functions/color/oklch/special_functions.hrx @@ -0,0 +1,142 @@ +<===> calculation/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(calc(1px + 1%) 0.2 3deg)); + +<===> calculation/arg_1/output.css +a { + value: oklch(calc(1px + 1%) 0.2 3deg); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% calc(1px + 1%) 3deg)); + +<===> calculation/arg_2/output.css +a { + value: oklch(1% calc(1px + 1%) 3deg); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 calc(1px + 1%))); + +<===> calculation/arg_3/output.css +a { + value: oklch(1% 0.2 calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> calculation/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / calc(1px + 1%))); + +<===> calculation/arg_4/output.css +a { + value: oklch(1% 0.2 3deg/calc(1px + 1%)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_1/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(var(--foo) 0.2 3deg)); + +<===> var/arg_1/output.css +a { + value: oklch(var(--foo) 0.2 3deg); + type: string; +} + +<===> +================================================================================ +<===> var/arg_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% var(--foo) 3deg)); + +<===> var/arg_2/output.css +a { + value: oklch(1% var(--foo) 3deg); + type: string; +} + +<===> +================================================================================ +<===> var/arg_3/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 var(--foo))); + +<===> var/arg_3/output.css +a { + value: oklch(1% 0.2 var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> var/arg_4/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% 0.2 3deg / var(--foo))); + +<===> var/arg_4/output.css +a { + value: oklch(1% 0.2 3deg/var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_2/input.scss +// var() is substituted before parsing, so it may contain multiple arguments. +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(var(--foo) 2deg)); + +<===> multi_argument_var/1_of_2/output.css +a { + value: oklch(var(--foo) 2deg); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/2_of_2/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(1% var(--foo))); + +<===> multi_argument_var/2_of_2/output.css +a { + value: oklch(1% var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/no_alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(var(--foo))); + +<===> multi_argument_var/1_of_1/no_alpha/output.css +a { + value: oklch(var(--foo)); + type: string; +} + +<===> +================================================================================ +<===> multi_argument_var/1_of_1/alpha/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(oklch(var(--foo) / 0.4)); + +<===> multi_argument_var/1_of_1/alpha/output.css +a { + value: oklch(var(--foo)/0.4); + type: string; +} diff --git a/spec/core_functions/color/red.hrx b/spec/core_functions/color/red.hrx index 21ac8a4d08..4b582f2400 100644 --- a/spec/core_functions/color/red.hrx +++ b/spec/core_functions/color/red.hrx @@ -7,6 +7,19 @@ a { b: 255; } +<===> max/warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.red(rgb(255, 0, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss @@ -18,6 +31,19 @@ a { b: 0; } +<===> min/warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.red(rgb(0, 0, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/input.scss @@ -29,6 +55,19 @@ a { b: 123; } +<===> middle/warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.red(rgb(123, 0, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss @@ -40,6 +79,19 @@ a { b: 234; } +<===> named/warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.red($color: rgb(234, 0, 0))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -89,3 +141,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.red(color(srgb 1 1 1))} + +<===> error/non_legacy/error +Error: color.red() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.red(color(srgb 1 1 1))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/rgb/error/one_arg.hrx b/spec/core_functions/color/rgb/error/one_arg.hrx index f257795f65..a1e01ce11a 100644 --- a/spec/core_functions/color/rgb/error/one_arg.hrx +++ b/spec/core_functions/color/rgb/error/one_arg.hrx @@ -4,7 +4,7 @@ a { } <===> list/empty/error -Error: Missing element $red. +Error: $channels: Color component list may not be empty. , 2 | b: rgb(()); | ^^^^^^^ @@ -19,7 +19,7 @@ a { } <===> list/one_element/error -Error: Missing element $green. +Error: $channels: The rgb color space has 3 channels but 1 has 1. , 2 | b: rgb(1); | ^^^^^^ @@ -34,7 +34,7 @@ a { } <===> list/two_elements/error -Error: Missing element $blue. +Error: $channels: The rgb color space has 3 channels but (1 2) has 2. , 2 | b: rgb(1 2); | ^^^^^^^^ @@ -49,7 +49,7 @@ a { } <===> list/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The rgb color space has 3 channels but (1 2 3 0.4) has 4. , 2 | b: rgb(1 2 3 0.4); | ^^^^^^^^^^^^^^ @@ -64,7 +64,7 @@ a { } <===> list/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space- or slash-separated list, was (1, 2, 3) , 2 | b: rgb((1, 2, 3)); | ^^^^^^^^^^^^^^ @@ -79,7 +79,7 @@ a { } <===> list/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [1 2 3] , 2 | b: rgb([1 2 3]); | ^^^^^^^^^^^^ @@ -94,7 +94,7 @@ a { } <===> type/red/error -Error: $red: "foo" is not a number. +Error: $channels: Expected red channel to be a number, was "foo". , 2 | b: rgb("foo" 2 3); | ^^^^^^^^^^^^^^ @@ -109,7 +109,7 @@ a { } <===> type/green/error -Error: $green: "foo" is not a number. +Error: $channels: Expected green channel to be a number, was "foo". , 2 | b: rgb(1 "foo" 3); | ^^^^^^^^^^^^^^ @@ -124,7 +124,7 @@ a { } <===> type/blue/error -Error: $blue: "foo" is not a number. +Error: $channels: Expected blue channel to be a number, was "foo". , 2 | b: rgb(1 2 "foo"); | ^^^^^^^^^^^^^^ @@ -139,7 +139,7 @@ a { } <===> quoted_var_slash/error -Error: $blue: "var(--foo) / 0.4" is not a number. +Error: $channels: Expected blue channel to be a number, was "var(--foo) / 0.4". , 2 | b: rgb(1 2 "var(--foo) / 0.4"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -153,7 +153,7 @@ Error: $blue: "var(--foo) / 0.4" is not a number. a {b: rgb(list.append((), 1 2 3, $separator: slash))} <===> slash_list/too_few_elements/error -Error: Only 2 slash-separated elements allowed, but 1 was passed. +Error: $channels: Only 2 slash-separated elements allowed, but 1 was passed. , 2 | a {b: rgb(list.append((), 1 2 3, $separator: slash))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -167,7 +167,7 @@ Error: Only 2 slash-separated elements allowed, but 1 was passed. a {b: rgb(list.slash(1 2 3, 0.4, 1))} <===> slash_list/too_many_elements/error -Error: Only 2 slash-separated elements allowed, but 3 were passed. +Error: $channels: Only 2 slash-separated elements allowed, but 3 were passed. , 2 | a {b: rgb(list.slash(1 2 3, 0.4, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -181,7 +181,7 @@ Error: Only 2 slash-separated elements allowed, but 3 were passed. a {b: rgb(list.slash((), 1))} <===> slash_list/channels/empty/error -Error: Missing element $red. +Error: $channels: Color component list may not be empty. , 2 | a {b: rgb(list.slash((), 1))} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -195,7 +195,7 @@ Error: Missing element $red. a {b: rgb(list.slash((1, 2, 3), 1))} <===> slash_list/channels/comma_separated/error -Error: $channels must be a space-separated list. +Error: $channels: Expected a space-separated list, was (1, 2, 3) , 2 | a {b: rgb(list.slash((1, 2, 3), 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -209,7 +209,7 @@ Error: $channels must be a space-separated list. a {b: rgb(list.slash([1 2 3], 1))} <===> slash_list/channels/bracketed/error -Error: $channels must be an unbracketed list. +Error: $channels: Expected an unbracketed list, was [1 2 3] , 2 | a {b: rgb(list.slash([1 2 3], 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -223,7 +223,7 @@ Error: $channels must be an unbracketed list. a {b: rgb(list.slash(1, 1))} <===> slash_list/channels/one_element/error -Error: Missing element $green. +Error: $channels: The rgb color space has 3 channels but (1 / 1) has 1. , 2 | a {b: rgb(list.slash(1, 1))} | ^^^^^^^^^^^^^^^^^^^^^ @@ -237,7 +237,7 @@ Error: Missing element $green. a {b: rgb(list.slash(1 2, 1))} <===> slash_list/channels/two_elements/error -Error: Missing element $blue. +Error: $channels: The rgb color space has 3 channels but (1 2 / 1) has 2. , 2 | a {b: rgb(list.slash(1 2, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -251,7 +251,7 @@ Error: Missing element $blue. a {b: rgb(list.slash(1 2 3 0.4, 1))} <===> slash_list/channels/four_elements/error -Error: Only 3 elements allowed, but 4 were passed. +Error: $channels: The rgb color space has 3 channels but (1 2 3 0.4 / 1) has 4. , 2 | a {b: rgb(list.slash(1 2 3 0.4, 1))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/rgb/four_args/clamped.hrx b/spec/core_functions/color/rgb/four_args/clamped.hrx index ea4e6788df..d59ef5025e 100644 --- a/spec/core_functions/color/rgb/four_args/clamped.hrx +++ b/spec/core_functions/color/rgb/four_args/clamped.hrx @@ -3,34 +3,124 @@ Channels that are out of bounds are clamped within bounds. <===> ================================================================================ -<===> red/input.scss +<===> red/finite/input.scss a {b: rgb(256, 0, 0, 0.5)} -<===> red/output.css +<===> red/finite/output.css a { b: rgba(255, 0, 0, 0.5); } <===> ================================================================================ -<===> green/input.scss +<===> red/degenerate/positive_infinity/input.scss +a {b: rgb(calc(infinity), 0, 0, 0.5)} + +<===> red/degenerate/positive_infinity/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> red/degenerate/negative_infinity/input.scss +a {b: rgb(calc(-infinity), 0, 0, 0.5)} + +<===> red/degenerate/negative_infinity/output.css +a { + b: rgba(0, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> red/degenerate/nan/input.scss +a {b: rgb(calc(NaN), 0, 0, 0.5)} + +<===> red/degenerate/nan/output.css +a { + b: rgba(0, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> green/finite/input.scss a {b: rgb(0, -1, 0, 0.5)} -<===> green/output.css +<===> green/finite/output.css +a { + b: rgba(0, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> green/degenerate/positive_infinity/input.scss +a {b: rgb(0, calc(infinity), 0, 0.5)} + +<===> green/degenerate/positive_infinity/output.css +a { + b: rgba(0, 255, 0, 0.5); +} + +<===> +================================================================================ +<===> green/degenerate/negative_infinity/input.scss +a {b: rgb(0, calc(-infinity), 0, 0.5)} + +<===> green/degenerate/negative_infinity/output.css +a { + b: rgba(0, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> green/degenerate/nan/input.scss +a {b: rgb(0, calc(NaN), 0, 0.5)} + +<===> green/degenerate/nan/output.css a { b: rgba(0, 0, 0, 0.5); } <===> ================================================================================ -<===> blue/input.scss +<===> blue/finite/input.scss a {b: rgb(0, 0, 9999, 0.5)} -<===> blue/output.css +<===> blue/finite/output.css a { b: rgba(0, 0, 255, 0.5); } +<===> +================================================================================ +<===> blue/degenerate/positive_infinity/input.scss +a {b: rgb(0, 0, calc(infinity), 0.5)} + +<===> blue/degenerate/positive_infinity/output.css +a { + b: rgba(0, 0, 255, 0.5); +} + +<===> +================================================================================ +<===> blue/degenerate/negative_infinity/input.scss +a {b: rgb(0, 0, calc(-infinity), 0.5)} + +<===> blue/degenerate/negative_infinity/output.css +a { + b: rgba(0, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> blue/degenerate/nan/input.scss +a {b: rgb(0, 0, calc(NaN), 0.5)} + +<===> blue/degenerate/nan/output.css +a { + b: rgba(0, 0, 0, 0.5); +} + <===> ================================================================================ <===> alpha/above/input.scss @@ -51,3 +141,32 @@ a { b: rgba(0, 0, 0, 0); } +<===> +================================================================================ +<===> alpha/degenerate/positive_infinity/input.scss +a {b: rgb(0, 0, 0, calc(infinity))} + +<===> alpha/degenerate/positive_infinity/output.css +a { + b: rgb(0, 0, 0); +} + +<===> +================================================================================ +<===> alpha/degenerate/negative_infinity/input.scss +a {b: rgb(0, 0, 0, calc(-infinity))} + +<===> alpha/degenerate/negative_infinity/output.css +a { + b: rgba(0, 0, 0, 0); +} + +<===> +================================================================================ +<===> alpha/degenerate/nan/input.scss +a {b: rgb(0, 0, 0, calc(NaN))} + +<===> alpha/degenerate/nan/output.css +a { + b: rgba(0, 0, 0, 0); +} diff --git a/spec/core_functions/color/rgb/four_args/special_functions.hrx b/spec/core_functions/color/rgb/four_args/special_functions.hrx index 96ff01f4c4..86e2a5d20f 100644 --- a/spec/core_functions/color/rgb/four_args/special_functions.hrx +++ b/spec/core_functions/color/rgb/four_args/special_functions.hrx @@ -1,9 +1,3 @@ -<===> options.yml -:todo: - - libsass - -<===> -================================================================================ <===> calc/string/arg_1/input.scss @use "sass:string"; a {b: rgb(string.unquote("calc(1)"), 2, 3, 0.4)} diff --git a/spec/core_functions/color/rgb/one_arg/alpha.hrx b/spec/core_functions/color/rgb/one_arg/alpha.hrx index 4de884a8cd..77d0e1875d 100644 --- a/spec/core_functions/color/rgb/one_arg/alpha.hrx +++ b/spec/core_functions/color/rgb/one_arg/alpha.hrx @@ -59,77 +59,132 @@ a { <===> ================================================================================ -<===> clamped/README.md -Channels that are out of bounds are clamped within bounds. +<===> bounds/red/above/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(256 0 0)); + +<===> bounds/red/above/output.css +a { + value: rgb(255, 0, 0); + space: rgb; + channels: 255 0 0 / 1; +} + +<===> +================================================================================ +<===> bounds/red/below/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(-1 0 0)); + +<===> bounds/red/below/output.css +a { + value: rgb(0, 0, 0); + space: rgb; + channels: 0 0 0 / 1; +} <===> ================================================================================ -<===> clamped/red/input.scss -a {b: rgb(256 0 0 / 0.5)} +<===> bounds/green/above/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 500 0)); -<===> clamped/red/output.css +<===> bounds/green/above/output.css a { - b: rgba(255, 0, 0, 0.5); + value: rgb(0, 255, 0); + space: rgb; + channels: 0 255 0 / 1; } <===> ================================================================================ -<===> clamped/green/input.scss -a {b: rgb(0 -1 0 / 0.5)} +<===> bounds/green/below/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 -100 0)); -<===> clamped/green/output.css +<===> bounds/green/below/output.css a { - b: rgba(0, 0, 0, 0.5); + value: rgb(0, 0, 0); + space: rgb; + channels: 0 0 0 / 1; } <===> ================================================================================ -<===> clamped/blue/input.scss -a {b: rgb(0 0 9999 / 0.5)} +<===> bounds/blue/above/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 0 999)); -<===> clamped/blue/output.css +<===> bounds/blue/above/output.css a { - b: rgba(0, 0, 255, 0.5); + value: rgb(0, 0, 255); + space: rgb; + channels: 0 0 255 / 1; } <===> ================================================================================ -<===> clamped/alpha/above/input.scss -a {b: rgb(0 0 0 / 1.1)} +<===> bounds/blue/below/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 0 -500)); -<===> clamped/alpha/above/output.css +<===> bounds/blue/below/output.css a { - b: rgb(0, 0, 0); + value: rgb(0, 0, 0); + space: rgb; + channels: 0 0 0 / 1; } <===> ================================================================================ -<===> clamped/alpha/below/input.scss -a {b: rgb(0 0 0 / -0.1)} +<===> bounds/alpha/unitless/above/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 0 0 / 1.1)); -<===> clamped/alpha/below/output.css +<===> bounds/alpha/unitless/above/output.css a { - b: rgba(0, 0, 0, 0); + value: rgb(0, 0, 0); + space: rgb; + channels: 0 0 0 / 1; } <===> ================================================================================ -<===> clamped/alpha/percent/above/input.scss -a {b: rgb(0 0 0 / 250%)} +<===> bounds/alpha/unitless/below/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 0 0 / -0.1)); -<===> clamped/alpha/percent/above/output.css +<===> bounds/alpha/unitless/below/output.css a { - b: rgb(0, 0, 0); + value: rgba(0, 0, 0, 0); + space: rgb; + channels: 0 0 0 / 0; } <===> ================================================================================ -<===> clamped/alpha/percent/below/input.scss -a {b: rgb(0 0 0 / -10%)} +<===> bounds/alpha/percent/above/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 0 0 / 250%)); -<===> clamped/alpha/percent/below/output.css +<===> bounds/alpha/percent/above/output.css a { - b: rgba(0, 0, 0, 0); + value: rgb(0, 0, 0); + space: rgb; + channels: 0 0 0 / 1; +} + +<===> +================================================================================ +<===> bounds/alpha/percent/below/input.scss +@use 'core_functions/color/utils'; +@include utils.inspect(rgb(0 0 0 / -10%)); + +<===> bounds/alpha/percent/below/output.css +a { + value: rgba(0, 0, 0, 0); + space: rgb; + channels: 0 0 0 / 0; } <===> @@ -142,3 +197,24 @@ a {b: rgb(list.slash(0 255 127, 0))} a { b: rgba(0, 255, 127, 0); } + +<===> +================================================================================ +<===> missing/slash/input.scss +a {b: rgb(0 255 127 / none)} + +<===> missing/slash/output.css +a { + b: rgb(0 255 127 / none); +} + +<===> +================================================================================ +<===> missing/slash_list/input.scss +@use 'sass:list'; +a {b: rgb(list.slash(0 255 127, none))} + +<===> missing/slash_list/output.css +a { + b: rgb(0 255 127 / none); +} diff --git a/spec/core_functions/color/rgb/one_arg/no_alpha.hrx b/spec/core_functions/color/rgb/one_arg/no_alpha.hrx index 6d1dc4b243..8d5c41608c 100644 --- a/spec/core_functions/color/rgb/one_arg/no_alpha.hrx +++ b/spec/core_functions/color/rgb/one_arg/no_alpha.hrx @@ -89,7 +89,7 @@ a {b: rgb(7.1% 20.4% 33.9%)} <===> percents/all/percent/output.css a { - b: rgb(18, 52, 86); + b: rgb(18.105, 52.02, 86.445); } <===> @@ -99,7 +99,7 @@ a {b: rgb(74.7% 173 93%)} <===> percents/unitless/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190.485, 173, 237.15); } <===> @@ -109,7 +109,7 @@ a {b: rgb(190 68% 237)} <===> percents/percent/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190, 173.4, 237); } <===> @@ -119,7 +119,7 @@ a {b: rgb(0% 100% 50%)} <===> percents/boundaries/output.css a { - b: rgb(0, 255, 128); + b: rgb(0, 255, 127.5); } <===> @@ -156,3 +156,33 @@ a {b: rgb(0 0 200%)} a { b: rgb(0, 0, 255); } + +<===> +================================================================================ +<===> missing/red/input.scss +a {b: rgb(none 52 66)} + +<===> missing/red/output.css +a { + b: rgb(none 52 66); +} + +<===> +================================================================================ +<===> missing/green/input.scss +a {b: rgb(18 none 66)} + +<===> missing/green/output.css +a { + b: rgb(18 none 66); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +a {b: rgb(18 52 none)} + +<===> missing/blue/output.css +a { + b: rgb(18 52 none); +} diff --git a/spec/core_functions/color/rgb/one_arg/relative_color.hrx b/spec/core_functions/color/rgb/one_arg/relative_color.hrx index bb44f0ef7d..429d4ee135 100644 --- a/spec/core_functions/color/rgb/one_arg/relative_color.hrx +++ b/spec/core_functions/color/rgb/one_arg/relative_color.hrx @@ -80,11 +80,11 @@ a { ================================================================================ <===> slash_list_alpha/input.scss @use "sass:list"; -a {b: rgb(list.slash(from #aaa h s l, 25%))} +a {b: rgb(list.slash(from #aaa r g b, 25%))} <===> slash_list_alpha/output.css a { - b: rgb(from #aaa h s l / 25%); + b: rgb(from #aaa r g b / 25%); } <===> @@ -93,7 +93,7 @@ a { a {b: rgb("from" #aaa r g b / 25%)} <===> error/quoted/alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected red channel to be a number, was "from". , 1 | a {b: rgb("from" #aaa r g b / 25%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -106,7 +106,7 @@ Error: Only 3 elements allowed, but 5 were passed. a {b: rgb("from" #aaa r g b)} <===> error/quoted/no_alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected red channel to be a number, was "from". , 1 | a {b: rgb("from" #aaa r g b)} | ^^^^^^^^^^^^^^^^^^^^^^ @@ -119,7 +119,7 @@ Error: Only 3 elements allowed, but 5 were passed. a {b: rgb(c #aaa r g b / 25%)} <===> error/wrong_keyword/alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected red channel to be a number, was c. , 1 | a {b: rgb(c #aaa r g b / 25%)} | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -132,7 +132,7 @@ Error: Only 3 elements allowed, but 5 were passed. a {b: rgb(c #aaa r g b)} <===> error/wrong_keyword/no_alpha/error -Error: Only 3 elements allowed, but 5 were passed. +Error: $channels: Expected red channel to be a number, was c. , 1 | a {b: rgb(c #aaa r g b)} | ^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx b/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx index 5624967010..604021210b 100644 --- a/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx +++ b/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx @@ -26,7 +26,7 @@ a {b: rgb(1 2 string.unquote("calc(3)") / 0.4)} <===> calc/string/arg_3/output.css a { - b: rgb(1 2 calc(3)/0.4); + b: rgb(1, 2, calc(3), 0.4); } <===> @@ -37,7 +37,7 @@ a {b: rgb(1 2 3 / string.unquote("calc(0.4)"))} <===> calc/string/arg_4/output.css a { - b: rgb(1 2 3/calc(0.4)); + b: rgb(1, 2, 3, calc(0.4)); } <===> @@ -67,7 +67,7 @@ a {b: rgb(1 2 calc(1px + 1%) / 0.4)} <===> calc/calculation/arg_3/output.css a { - b: rgb(1 2 calc(1px + 1%)/0.4); + b: rgb(1, 2, calc(1px + 1%), 0.4); } <===> @@ -77,7 +77,7 @@ a {b: rgb(1 2 3 / calc(1px + 1%))} <===> calc/calculation/arg_4/output.css a { - b: rgb(1 2 3/calc(1px + 1%)); + b: rgb(1, 2, 3, calc(1px + 1%)); } <===> @@ -107,7 +107,7 @@ a {b: rgb(1 2 var(--foo) / 0.4)} <===> var/arg_3/output.css a { - b: rgb(1 2 var(--foo)/0.4); + b: rgb(1, 2, var(--foo), 0.4); } <===> @@ -117,7 +117,7 @@ a {b: rgb(1 2 3 / var(--foo))} <===> var/arg_4/output.css a { - b: rgb(1 2 3/var(--foo)); + b: rgb(1, 2, 3, var(--foo)); } <===> @@ -147,7 +147,7 @@ a {b: rgb(1 2 env(--foo) / 0.4)} <===> env/arg_3/output.css a { - b: rgb(1 2 env(--foo)/0.4); + b: rgb(1, 2, env(--foo), 0.4); } <===> @@ -157,7 +157,7 @@ a {b: rgb(1 2 3 / env(--foo))} <===> env/arg_4/output.css a { - b: rgb(1 2 3/env(--foo)); + b: rgb(1, 2, 3, env(--foo)); } <===> @@ -190,7 +190,7 @@ a {b: rgb(1 2 string.unquote("min(3)") / 0.4)} <===> min/string/arg_3/output.css a { - b: rgb(1 2 min(3)/0.4); + b: rgb(1, 2, min(3), 0.4); } <===> @@ -201,7 +201,7 @@ a {b: rgb(1 2 3 / string.unquote("min(0.4)"))} <===> min/string/arg_4/output.css a { - b: rgb(1 2 3/min(0.4)); + b: rgb(1, 2, 3, min(0.4)); } <===> @@ -234,7 +234,7 @@ a {b: rgb(1 2 string.unquote("max(3)") / 0.4)} <===> max/string/arg_3/output.css a { - b: rgb(1 2 max(3)/0.4); + b: rgb(1, 2, max(3), 0.4); } <===> @@ -245,7 +245,7 @@ a {b: rgb(1 2 3 / string.unquote("max(0.4)"))} <===> max/string/arg_4/output.css a { - b: rgb(1 2 3/max(0.4)); + b: rgb(1, 2, 3, max(0.4)); } <===> @@ -278,7 +278,7 @@ a {b: rgb(1 2 string.unquote("clamp(3, 4, 5)") / 0.4)} <===> clamp/string/arg_3/output.css a { - b: rgb(1 2 clamp(3, 4, 5)/0.4); + b: rgb(1, 2, clamp(3, 4, 5), 0.4); } <===> @@ -289,7 +289,7 @@ a {b: rgb(1 2 3 / string.unquote("clamp(0.4, 0.5, 0.6)"))} <===> clamp/string/arg_4/output.css a { - b: rgb(1 2 3/clamp(0.4, 0.5, 0.6)); + b: rgb(1, 2, 3, clamp(0.4, 0.5, 0.6)); } <===> diff --git a/spec/core_functions/color/rgb/one_arg/special_functions/options.yml b/spec/core_functions/color/rgb/one_arg/special_functions/options.yml deleted file mode 100644 index ce0ef8b813..0000000000 --- a/spec/core_functions/color/rgb/one_arg/special_functions/options.yml +++ /dev/null @@ -1,2 +0,0 @@ -:todo: - - libsass diff --git a/spec/core_functions/color/rgb/three_args/percents.hrx b/spec/core_functions/color/rgb/three_args/percents.hrx index 0a471421d0..6572c45523 100644 --- a/spec/core_functions/color/rgb/three_args/percents.hrx +++ b/spec/core_functions/color/rgb/three_args/percents.hrx @@ -9,7 +9,7 @@ a {b: rgb(7.1%, 20.4%, 33.9%)} <===> all/percent/output.css a { - b: rgb(18, 52, 86); + b: rgb(18.105, 52.02, 86.445); } <===> @@ -19,7 +19,7 @@ a {b: rgb(74.7%, 173, 93%)} <===> unitless/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190.485, 173, 237.15); } <===> @@ -29,7 +29,7 @@ a {b: rgb(190, 68%, 237)} <===> percent/green/output.css a { - b: rgb(190, 173, 237); + b: rgb(190, 173.4, 237); } <===> @@ -39,7 +39,7 @@ a {b: rgb(0%, 100%, 50%)} <===> boundaries/output.css a { - b: rgb(0, 255, 128); + b: rgb(0, 255, 127.5); } <===> diff --git a/spec/core_functions/color/same.hrx b/spec/core_functions/color/same.hrx new file mode 100644 index 0000000000..a507389e35 --- /dev/null +++ b/spec/core_functions/color/same.hrx @@ -0,0 +1,244 @@ +<===> true/same_space/identical/input.scss +@use "sass:color"; +a {b: color.same(#abcdef, #abcdef)} + +<===> true/same_space/identical/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/same_space/within_epsilon/input.scss +@use "sass:color"; +a { + b: color.same( + lab(50.0000000000001 29.9999999999999 -20.0000000000001), + lab(50 30 -20) + ); +} + +<===> true/same_space/within_epsilon/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/same_space/with_alpha/input.scss +@use "sass:color"; +a {b: color.same(oklch(50% 30% 120deg / 0.3), oklch(50% 30% 120deg / 0.3))} + +<===> true/same_space/with_alpha/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/same_space/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.same(color(srgb 2.3 -1 42), color(srgb 2.3 -1 42))} + +<===> true/same_space/out_of_gamut/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/same_space/none_and_zero/input.scss +@use "sass:color"; +a {b: color.same(color(display-p3 0.1 0.3 none), color(display-p3 0.1 0.3 0))} + +<===> true/same_space/none_and_zero/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/same_space/both_none/input.scss +@use "sass:color"; +a { + b: color.same(color(display-p3 0.1 0.3 none), color(display-p3 0.1 0.3 none)); +} + +<===> true/same_space/both_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/different_space/no_none/input.scss +@use "sass:color"; +a {b: color.same(plum, hsl(300, 47.2868217054%, 74.7058823529%))} + +<===> true/different_space/no_none/output.css +a { + b: true; +} + + +<===> +================================================================================ +<===> true/different_space/one_none/input.scss +@use "sass:color"; +a { + b: color.same( + color(rec2020 0.5 none 0.2), + oklab(44.668866707461% 0.236673642675 0.018728349677) + ); +} + +<===> true/different_space/one_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/different_space/both_none/input.scss +@use "sass:color"; +a { + b: color.same( + color(srgb-linear none 0.9 0.8), + rgb(none 243.445228830895 231.114597102735) + ); +} + +<===> true/different_space/both_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> false/same_space/no_none/input.scss +@use "sass:color"; +a {b: color.same(#abcdef, #fedcba)} + +<===> false/same_space/no_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/same_space/none_and_nonzero/input.scss +@use "sass:color"; +a { + b: color.same( + color(prophoto-rgb 0.1 0.2 none), + color(prophoto-rgb 0.1 0.2 0.3) + ); +} + +<===> false/same_space/none_and_nonzero/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/different_space/no_none/input.scss +@use "sass:color"; +a {b: color.same(color(srgb 0.1 0.2 0.3), color(srgb-linear 0.1 0.2 0.3))} + +<===> false/different_space/no_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/different_space/both_none/input.scss +// This test verifies that none is converted to 0 *before* conversion to XYZ. +@use "sass:color"; +a { + b: color.same( + color(rec2020 0.5 none 0.2), + color(xyz 0.174805932224126 none 0.058901333881161) + ); +} + +<===> false/different_space/both_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.same($color1: red, $color2: green)} + +<===> named/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> error/too_few_args/input.scss +@use "sass:color"; +a {b: color.same(plum)} + +<===> error/too_few_args/error +Error: Missing argument $color2. + ,--> input.scss +2 | a {b: color.same(plum)} + | ^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function same($color1, $color2) { + | ====================== declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +@use "sass:color"; +a {b: color.same(red, green, blue)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +2 | a {b: color.same(red, green, blue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function same($color1, $color2) { + | ====================== declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color1/input.scss +@use "sass:color"; +a {b: color.same(1, red)} + +<===> error/type/color1/error +Error: $color1: 1 is not a color. + , +2 | a {b: color.same(1, red)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/type/color2/input.scss +@use "sass:color"; +a {b: color.same(red, 1)} + +<===> error/type/color2/error +Error: $color2: 1 is not a color. + , +2 | a {b: color.same(red, 1)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/saturate.hrx b/spec/core_functions/color/saturate.hrx index 492c1c842a..21c300ca32 100644 --- a/spec/core_functions/color/saturate.hrx +++ b/spec/core_functions/color/saturate.hrx @@ -74,3 +74,277 @@ a {b: saturate($amount: 50%)} a { b: saturate(50%); } + +<===> +================================================================================ +<===> two_args/max/input.scss +a {b: saturate(plum, 100%)} + +<===> two_args/max/output.css +a { + b: #ff7eff; +} + +<===> two_args/max/warning +DEPRECATION WARNING: saturate() is deprecated. Suggestions: + +color.scale($color, $saturation: 100%) +color.adjust($color, $saturation: 100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturate(plum, 100%)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> two_args/max_remaining/input.scss +a {b: saturate(plum, 53%)} + +<===> two_args/max_remaining/output.css +a { + b: #ff7eff; +} + +<===> two_args/max_remaining/warning +DEPRECATION WARNING: saturate() is deprecated. Suggestions: + +color.scale($color, $saturation: 100%) +color.adjust($color, $saturation: 53%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturate(plum, 53%)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> two_args/min/input.scss +a {b: saturate(plum, 0%)} + +<===> two_args/min/output.css +a { + b: plum; +} + +<===> two_args/min/warning +DEPRECATION WARNING: saturate() is deprecated. Suggestion: + +color.adjust($color, $saturation: 0%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturate(plum, 0%)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> two_args/middle/input.scss +a {b: saturate(plum, 14%)} + +<===> two_args/middle/output.css +a { + b: rgb(230.03, 150.97, 230.03); +} + +<===> two_args/middle/warning +DEPRECATION WARNING: saturate() is deprecated. Suggestions: + +color.scale($color, $saturation: 26.5588235294%) +color.adjust($color, $saturation: 14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturate(plum, 14%)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> two_args/alpha/input.scss +a {b: saturate(rgba(plum, 0.5), 100%)} + +<===> two_args/alpha/output.css +a { + b: rgba(255, 126, 255, 0.5); +} + +<===> two_args/alpha/warning +DEPRECATION WARNING: saturate() is deprecated. Suggestions: + +color.scale($color, $saturation: 100%) +color.adjust($color, $saturation: 100%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturate(rgba(plum, 0.5), 100%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> two_args/named/input.scss +a {b: saturate($color: plum, $amount: 14%)} + +<===> two_args/named/output.css +a { + b: rgb(230.03, 150.97, 230.03); +} + +<===> two_args/named/warning +DEPRECATION WARNING: saturate() is deprecated. Suggestions: + +color.scale($color, $saturation: 26.5588235294%) +color.adjust($color, $saturation: 14%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturate($color: plum, $amount: 14%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_few_args/input.scss +a {b: saturate()} + +<===> error/too_few_args/error +Error: Missing argument $amount. + ,--> input.scss +1 | a {b: saturate()} + | ^^^^^^^^^^ invocation + ' + , +1 | @function saturate($amount) { + | ================= declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: saturate(plum, 1%, 2)} + +<===> error/too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +1 | a {b: saturate(plum, 1%, 2)} + | ^^^^^^^^^^^^^^^^^^^^^ invocation + ' + , +1 | @function saturate($color, $amount) { + | ========================= declaration + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/one_arg/type/input.scss +a {b: saturate(red)} + +<===> error/one_arg/type/error +Error: $amount: red is not a number. + , +1 | a {b: saturate(red)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + + +<===> +================================================================================ +<===> error/with_module/one_arg/type/input.scss +@use "sass:color"; +a {b: color.saturate(var(--c))} + +<===> error/with_module/one_arg/type/error +Error: Missing argument $amount. + ,--> input.scss +2 | a {b: color.saturate(var(--c))} + | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function saturate($color, $amount) { + | ========================= declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/two_args/type/color/input.scss +a {b: saturate(1, 2)} + +<===> error/two_args/type/color/error +Error: $color: 1 is not a color. + , +1 | a {b: saturate(1, 2)} + | ^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/two_args/type/lightness/input.scss +a {b: saturate(plum, blue)} + +<===> error/two_args/type/lightness/error +Error: $amount: blue is not a number. + , +1 | a {b: saturate(plum, blue)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/two_args/bounds/too_low/input.scss +a {b: saturate(plum, -0.001)} + +<===> error/two_args/bounds/too_low/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: saturate(plum, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/two_args/bounds/too_high/input.scss +a {b: saturate(plum, 100.001)} + +<===> error/two_args/bounds/too_high/error +Error: $amount: Expected 100.001 to be within 0 and 100. + , +1 | a {b: saturate(plum, 100.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +a {b: saturate(color(srgb 1 1 1), 10%)} + +<===> error/non_legacy/error +Error: saturate() is only supported for legacy colors. Please use color.adjust() instead with an explicit $space argument. + , +1 | a {b: saturate(color(srgb 1 1 1), 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/saturation.hrx b/spec/core_functions/color/saturation.hrx index abe94b95f1..19ebd4877c 100644 --- a/spec/core_functions/color/saturation.hrx +++ b/spec/core_functions/color/saturation.hrx @@ -7,6 +7,19 @@ a { b: 100%; } +<===> max/warning +DEPRECATION WARNING: color.saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.saturation(hsl(0, 100%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss @@ -18,6 +31,19 @@ a { b: 0%; } +<===> min/warning +DEPRECATION WARNING: color.saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.saturation(hsl(0, 0%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/input.scss @@ -29,6 +55,19 @@ a { b: 50%; } +<===> middle/warning +DEPRECATION WARNING: color.saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.saturation(hsl(0, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> fraction/input.scss @@ -40,6 +79,19 @@ a { b: 0.5%; } +<===> fraction/warning +DEPRECATION WARNING: color.saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.saturation(hsl(0, 0.5%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss @@ -51,6 +103,19 @@ a { b: 42%; } +<===> named/warning +DEPRECATION WARNING: color.saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.saturation($color: hsl(0, 42%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -100,3 +165,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.saturation(color(srgb 1 1 1))} + +<===> error/non_legacy/error +Error: color.saturation() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.saturation(color(srgb 1 1 1))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/a98_rgb.hrx b/spec/core_functions/color/scale/a98_rgb.hrx new file mode 100644 index 0000000000..404ec2e67a --- /dev/null +++ b/spec/core_functions/color/scale/a98_rgb.hrx @@ -0,0 +1,225 @@ +<===> red/max/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: 100%)} + +<===> red/max/output.css +a { + b: color(a98-rgb 1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/min/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: -100%)} + +<===> red/min/output.css +a { + b: color(a98-rgb 0 0.5 0.7); +} + +<===> +================================================================================ +<===> red/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: 0%)} + +<===> red/zero/output.css +a { + b: color(a98-rgb 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/low/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: -33%)} + +<===> red/low/output.css +a { + b: color(a98-rgb 0.134 0.5 0.7); +} + +<===> +================================================================================ +<===> red/high/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: 86%)} + +<===> red/high/output.css +a { + b: color(a98-rgb 0.888 0.5 0.7); +} + +<===> +================================================================================ +<===> green/max/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: 100%)} + +<===> green/max/output.css +a { + b: color(a98-rgb 0.2 1 0.7); +} + +<===> +================================================================================ +<===> green/min/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: -100%)} + +<===> green/min/output.css +a { + b: color(a98-rgb 0.2 0 0.7); +} + +<===> +================================================================================ +<===> green/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: 0%)} + +<===> green/zero/output.css +a { + b: color(a98-rgb 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/low/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: -86%)} + +<===> green/low/output.css +a { + b: color(a98-rgb 0.2 0.07 0.7); +} + +<===> +================================================================================ +<===> green/high/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: 12%)} + +<===> green/high/output.css +a { + b: color(a98-rgb 0.2 0.56 0.7); +} + +<===> +================================================================================ +<===> blue/max/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: 100%)} + +<===> blue/max/output.css +a { + b: color(a98-rgb 0.2 0.5 1); +} + +<===> +================================================================================ +<===> blue/min/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: -100%)} + +<===> blue/min/output.css +a { + b: color(a98-rgb 0.2 0.5 0); +} + +<===> +================================================================================ +<===> blue/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: 0%)} + +<===> blue/zero/output.css +a { + b: color(a98-rgb 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> blue/low/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: -16%)} + +<===> blue/low/output.css +a { + b: color(a98-rgb 0.2 0.5 0.588); +} + +<===> +================================================================================ +<===> blue/high/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: 42%)} + +<===> blue/high/output.css +a { + b: color(a98-rgb 0.2 0.5 0.826); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale( + color(a98-rgb 0.2 0.5 0.7), $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> all/output.css +a { + b: color(a98-rgb 0.296 0.62 0.844); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale( + color(a98-rgb 0.2 0.5 0.7 / 0.3), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> alpha_input/output.css +a { + b: color(a98-rgb 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + color(a98-rgb 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: color(a98-rgb 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale( + $color: color(a98-rgb 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> named/output.css +a { + b: color(a98-rgb 0.296 0.62 0.844); +} diff --git a/spec/core_functions/color/scale/display_p3.hrx b/spec/core_functions/color/scale/display_p3.hrx new file mode 100644 index 0000000000..f7c037d0a1 --- /dev/null +++ b/spec/core_functions/color/scale/display_p3.hrx @@ -0,0 +1,225 @@ +<===> red/max/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: 100%)} + +<===> red/max/output.css +a { + b: color(display-p3 1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/min/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: -100%)} + +<===> red/min/output.css +a { + b: color(display-p3 0 0.5 0.7); +} + +<===> +================================================================================ +<===> red/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: 0%)} + +<===> red/zero/output.css +a { + b: color(display-p3 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/low/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: -33%)} + +<===> red/low/output.css +a { + b: color(display-p3 0.134 0.5 0.7); +} + +<===> +================================================================================ +<===> red/high/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: 86%)} + +<===> red/high/output.css +a { + b: color(display-p3 0.888 0.5 0.7); +} + +<===> +================================================================================ +<===> green/max/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: 100%)} + +<===> green/max/output.css +a { + b: color(display-p3 0.2 1 0.7); +} + +<===> +================================================================================ +<===> green/min/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: -100%)} + +<===> green/min/output.css +a { + b: color(display-p3 0.2 0 0.7); +} + +<===> +================================================================================ +<===> green/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: 0%)} + +<===> green/zero/output.css +a { + b: color(display-p3 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/low/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: -86%)} + +<===> green/low/output.css +a { + b: color(display-p3 0.2 0.07 0.7); +} + +<===> +================================================================================ +<===> green/high/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: 12%)} + +<===> green/high/output.css +a { + b: color(display-p3 0.2 0.56 0.7); +} + +<===> +================================================================================ +<===> blue/max/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: 100%)} + +<===> blue/max/output.css +a { + b: color(display-p3 0.2 0.5 1); +} + +<===> +================================================================================ +<===> blue/min/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: -100%)} + +<===> blue/min/output.css +a { + b: color(display-p3 0.2 0.5 0); +} + +<===> +================================================================================ +<===> blue/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: 0%)} + +<===> blue/zero/output.css +a { + b: color(display-p3 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> blue/low/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: -16%)} + +<===> blue/low/output.css +a { + b: color(display-p3 0.2 0.5 0.588); +} + +<===> +================================================================================ +<===> blue/high/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: 42%)} + +<===> blue/high/output.css +a { + b: color(display-p3 0.2 0.5 0.826); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale( + color(display-p3 0.2 0.5 0.7), $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> all/output.css +a { + b: color(display-p3 0.296 0.62 0.844); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale( + color(display-p3 0.2 0.5 0.7 / 0.3), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> alpha_input/output.css +a { + b: color(display-p3 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + color(display-p3 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: color(display-p3 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale( + $color: color(display-p3 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> named/output.css +a { + b: color(display-p3 0.296 0.62 0.844); +} diff --git a/spec/core_functions/color/scale_color/error/args.hrx b/spec/core_functions/color/scale/error/args.hrx similarity index 97% rename from spec/core_functions/color/scale_color/error/args.hrx rename to spec/core_functions/color/scale/error/args.hrx index 2b844dc62f..4da8c45bb7 100644 --- a/spec/core_functions/color/scale_color/error/args.hrx +++ b/spec/core_functions/color/scale/error/args.hrx @@ -35,7 +35,7 @@ Error: Only one positional argument is allowed. All other arguments must be pass a {b: color.scale(red, $hue: 10%)} <===> unknown/error -Error: No argument named $hue. +Error: $hue: Channel isn't scalable. , 2 | a {b: color.scale(red, $hue: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -55,4 +55,3 @@ Error: Undefined function. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet - diff --git a/spec/core_functions/color/scale/error/bounds.hrx b/spec/core_functions/color/scale/error/bounds.hrx new file mode 100644 index 0000000000..f470062b51 --- /dev/null +++ b/spec/core_functions/color/scale/error/bounds.hrx @@ -0,0 +1,53 @@ +<===> legacy/too_low/input.scss +@use "sass:color"; +a {b: color.scale(red, $saturation: -100.001%)} + +<===> legacy/too_low/error +Error: $saturation: Expected -100.001% to be within -100% and 100%. + , +2 | a {b: color.scale(red, $saturation: -100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> legacy/too_high/input.scss +@use "sass:color"; +a {b: color.scale(red, $whiteness: 100.001%)} + +<===> legacy/too_high/error +Error: $whiteness: Expected 100.001% to be within -100% and 100%. + , +2 | a {b: color.scale(red, $whiteness: 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern/too_low/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% -70 60), $a: -100.001%)} + +<===> modern/too_low/error +Error: $a: Expected -100.001% to be within -100% and 100%. + , +2 | a {b: color.scale(lab(50% -70 60), $a: -100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern/too_high/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% -70 60), $b: 100.001%)} + +<===> modern/too_high/error +Error: $b: Expected 100.001% to be within -100% and 100%. + , +2 | a {b: color.scale(lab(50% -70 60), $b: 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/incompatible_channel.hrx b/spec/core_functions/color/scale/error/incompatible_channel.hrx new file mode 100644 index 0000000000..cf404a9d26 --- /dev/null +++ b/spec/core_functions/color/scale/error/incompatible_channel.hrx @@ -0,0 +1,39 @@ +<===> legacy_space/input.scss +@use "sass:color"; +a {b: color.scale(red, $chroma: 50%)} + +<===> legacy_space/error +Error: $chroma: Color space rgb doesn't have a channel with this name. + , +2 | a {b: color.scale(red, $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> legacy_channel/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + +<===> legacy_channel/error +Error: $whiteness: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern_both/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + +<===> modern_both/error +Error: $chroma: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/missing.hrx b/spec/core_functions/color/scale/error/missing.hrx new file mode 100644 index 0000000000..b6d2bba0bb --- /dev/null +++ b/spec/core_functions/color/scale/error/missing.hrx @@ -0,0 +1,39 @@ +<===> legacy/input.scss +@use "sass:color"; +a {b: color.scale(rgb(none 0 0), $red: 10%)} + +<===> legacy/error +Error: $red: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: rgb(none 0 0)). + , +2 | a {b: color.scale(rgb(none 0 0), $red: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern/input.scss +@use "sass:color"; +a {b: color.scale(lab(none 0 0), $lightness: 10%, $space: lab)} + +<===> modern/error +Error: $lightness: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: lab(none 0 0)). + , +2 | a {b: color.scale(lab(none 0 0), $lightness: 10%, $space: lab)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/input.scss +@use "sass:color"; +a {b: color.scale(rgb(0 0 0 / none), $alpha: 10%)} + +<===> alpha/error +Error: $alpha: Because the CSS working group is still deciding on the best behavior, Sass doesn't currently support modifying missing channels (color: rgb(0 0 0 / none)). + , +2 | a {b: color.scale(rgb(0 0 0 / none), $alpha: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/error/mixed_formats.hrx b/spec/core_functions/color/scale/error/mixed_formats.hrx similarity index 83% rename from spec/core_functions/color/scale_color/error/mixed_formats.hrx rename to spec/core_functions/color/scale/error/mixed_formats.hrx index bce79e9f9c..20620a690d 100644 --- a/spec/core_functions/color/scale_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/scale/error/mixed_formats.hrx @@ -3,7 +3,7 @@ a {b: color.scale(red, $red: 1%, $saturation: 1%)} <===> red_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.scale(red, $red: 1%, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.scale(red, $green: 1%, $saturation: 1%)} <===> green_and_saturation/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $saturation: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.scale(red, $green: 1%, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.scale(red, $blue: 1%, $lightness: 1%)} <===> blue_and_lightness/error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $lightness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.scale(red, $blue: 1%, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ Error: RGB parameters may not be passed along with HSL parameters. a {b: color.scale(red, $red: 1%, $blackness: 1%)} <===> red_and_blackness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $blackness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.scale(red, $red: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: color.scale(red, $green: 1%, $whiteness: 1%)} <===> green_and_whiteness/error -Error: RGB parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space rgb doesn't have a channel with this name. , 2 | a {b: color.scale(red, $green: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -73,7 +73,7 @@ Error: RGB parameters may not be passed along with HWB parameters. a {b: color.scale(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $blackness: Color space hsl doesn't have a channel with this name. , 2 | a {b: color.scale(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -87,7 +87,7 @@ Error: HSL parameters may not be passed along with HWB parameters. a {b: color.scale(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error -Error: HSL parameters may not be passed along with HWB parameters. +Error: $whiteness: Color space hsl doesn't have a channel with this name. , 2 | a {b: color.scale(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/scale/error/polar.hrx b/spec/core_functions/color/scale/error/polar.hrx new file mode 100644 index 0000000000..2f1c5d7344 --- /dev/null +++ b/spec/core_functions/color/scale/error/polar.hrx @@ -0,0 +1,39 @@ +<===> legacy/input.scss +@use "sass:color"; +a {b: color.scale(white, $hue: 10%)} + +<===> legacy/error +Error: $hue: Channel isn't scalable. + , +2 | a {b: color.scale(white, $hue: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> lch/input.scss +@use "sass:color"; +a {b: color.scale(lch(50% 30% 180deg), $hue: 10%)} + +<===> lch/error +Error: $hue: Channel isn't scalable. + , +2 | a {b: color.scale(lch(50% 30% 180deg), $hue: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> oklch/input.scss +@use "sass:color"; +a {b: color.scale(lch(50% 30% 180deg), $hue: 10%)} + +<===> oklch/error +Error: $hue: Channel isn't scalable. + , +2 | a {b: color.scale(lch(50% 30% 180deg), $hue: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/space.hrx b/spec/core_functions/color/scale/error/space.hrx new file mode 100644 index 0000000000..46c2c6c42b --- /dev/null +++ b/spec/core_functions/color/scale/error/space.hrx @@ -0,0 +1,25 @@ +<===> unknown/input.scss +@use "sass:color"; +a {b: color.scale(red, $space: c)} + +<===> unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.scale(red, $space: c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> quoted/input.scss +@use "sass:color"; +a {b: color.scale(red, $space: "lab")} + +<===> quoted/error +Error: $space: Expected "lab" to be an unquoted string. + , +2 | a {b: color.scale(red, $space: "lab")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/error/type.hrx b/spec/core_functions/color/scale/error/type.hrx similarity index 81% rename from spec/core_functions/color/scale_color/error/type.hrx rename to spec/core_functions/color/scale/error/type.hrx index 43da61715b..95eee880b4 100644 --- a/spec/core_functions/color/scale_color/error/type.hrx +++ b/spec/core_functions/color/scale/error/type.hrx @@ -94,6 +94,20 @@ Error: $alpha: c is not a number. ' input.scss 2:7 root stylesheet +<===> +================================================================================ +<===> none/input.scss +@use "sass:color"; +a {b: color.scale(red, $alpha: none)} + +<===> none/error +Error: $alpha: none is not a number. + , +2 | a {b: color.scale(red, $alpha: none)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> blackness/input.scss @@ -121,3 +135,17 @@ Error: $whiteness: c is not a number. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/input.scss +@use "sass:color"; +a {b: color.scale(red, $space: 1)} + +<===> space/error +Error: $space: 1 is not a string. + , +2 | a {b: color.scale(red, $space: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/a98_rgb.hrx b/spec/core_functions/color/scale/error/units/a98_rgb.hrx new file mode 100644 index 0000000000..69326ff261 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/a98_rgb.hrx @@ -0,0 +1,81 @@ +<===> none/red/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: 1)} + +<===> none/red/error +Error: $red: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/green/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: 1)} + +<===> none/green/error +Error: $green: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: 1)} + +<===> none/blue/error +Error: $blue: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/red/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: 1px)} + +<===> wrong/red/error +Error: $red: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $red: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/green/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: 1px)} + +<===> wrong/green/error +Error: $green: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $green: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: 1px)} + +<===> wrong/blue/error +Error: $blue: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(a98-rgb 0.2 0.5 0.7), $blue: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/display_p3.hrx b/spec/core_functions/color/scale/error/units/display_p3.hrx new file mode 100644 index 0000000000..ef2e712ade --- /dev/null +++ b/spec/core_functions/color/scale/error/units/display_p3.hrx @@ -0,0 +1,81 @@ +<===> none/red/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: 1)} + +<===> none/red/error +Error: $red: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/green/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: 1)} + +<===> none/green/error +Error: $green: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: 1)} + +<===> none/blue/error +Error: $blue: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/red/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: 1px)} + +<===> wrong/red/error +Error: $red: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(display-p3 0.2 0.5 0.7), $red: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/green/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: 1px)} + +<===> wrong/green/error +Error: $green: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(display-p3 0.2 0.5 0.7), $green: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: 1px)} + +<===> wrong/blue/error +Error: $blue: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(display-p3 0.2 0.5 0.7), $blue: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/hsl.hrx b/spec/core_functions/color/scale/error/units/hsl.hrx new file mode 100644 index 0000000000..a113686237 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/hsl.hrx @@ -0,0 +1,53 @@ +<===> none/saturation/input.scss +@use "sass:color"; +a {b: color.scale(white, $saturation: 1)} + +<===> none/saturation/error +Error: $saturation: Expected 1 to have unit "%". + , +2 | a {b: color.scale(white, $saturation: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/lightness/input.scss +@use "sass:color"; +a {b: color.scale(white, $lightness: 1)} + +<===> none/lightness/error +Error: $lightness: Expected 1 to have unit "%". + , +2 | a {b: color.scale(white, $lightness: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/saturation/input.scss +@use "sass:color"; +a {b: color.scale(white, $saturation: 1px)} + +<===> wrong/saturation/error +Error: $saturation: Expected 1px to have unit "%". + , +2 | a {b: color.scale(white, $saturation: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/lightness/input.scss +@use "sass:color"; +a {b: color.scale(white, $lightness: 1px)} + +<===> wrong/lightness/error +Error: $lightness: Expected 1px to have unit "%". + , +2 | a {b: color.scale(white, $lightness: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/hwb.hrx b/spec/core_functions/color/scale/error/units/hwb.hrx new file mode 100644 index 0000000000..772efb34a2 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/hwb.hrx @@ -0,0 +1,53 @@ +<===> none/whiteness/input.scss +@use "sass:color"; +a {b: color.scale(white, $whiteness: 1)} + +<===> none/whiteness/error +Error: $whiteness: Expected 1 to have unit "%". + , +2 | a {b: color.scale(white, $whiteness: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blackness/input.scss +@use "sass:color"; +a {b: color.scale(white, $blackness: 1)} + +<===> none/blackness/error +Error: $blackness: Expected 1 to have unit "%". + , +2 | a {b: color.scale(white, $blackness: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/whiteness/input.scss +@use "sass:color"; +a {b: color.scale(white, $whiteness: 1px)} + +<===> wrong/whiteness/error +Error: $whiteness: Expected 1px to have unit "%". + , +2 | a {b: color.scale(white, $whiteness: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blackness/input.scss +@use "sass:color"; +a {b: color.scale(white, $blackness: 1px)} + +<===> wrong/blackness/error +Error: $blackness: Expected 1px to have unit "%". + , +2 | a {b: color.scale(white, $blackness: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/lab.hrx b/spec/core_functions/color/scale/error/units/lab.hrx new file mode 100644 index 0000000000..8b184aeaec --- /dev/null +++ b/spec/core_functions/color/scale/error/units/lab.hrx @@ -0,0 +1,81 @@ +<===> none/lightness/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 40% -20%), $lightness: 1)} + +<===> none/lightness/error +Error: $lightness: Expected 1 to have unit "%". + , +2 | a {b: color.scale(lab(50% 40% -20%), $lightness: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/a/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 40% -20%), $a: 1)} + +<===> none/a/error +Error: $a: Expected 1 to have unit "%". + , +2 | a {b: color.scale(lab(50% 40% -20%), $a: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/b/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 40% -20%), $b: 1)} + +<===> none/b/error +Error: $b: Expected 1 to have unit "%". + , +2 | a {b: color.scale(lab(50% 40% -20%), $b: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/lightness/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 40% -20%), $lightness: 1px)} + +<===> wrong/lightness/error +Error: $lightness: Expected 1px to have unit "%". + , +2 | a {b: color.scale(lab(50% 40% -20%), $lightness: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/a/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 40% -20%), $a: 1px)} + +<===> wrong/a/error +Error: $a: Expected 1px to have unit "%". + , +2 | a {b: color.scale(lab(50% 40% -20%), $a: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/b/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 40% -20%), $b: 1px)} + +<===> wrong/b/error +Error: $b: Expected 1px to have unit "%". + , +2 | a {b: color.scale(lab(50% 40% -20%), $b: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/lch.hrx b/spec/core_functions/color/scale/error/units/lch.hrx new file mode 100644 index 0000000000..fc3c27d3d4 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/lch.hrx @@ -0,0 +1,53 @@ +<===> none/lightness/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $lightness: 1)} + +<===> none/lightness/error +Error: $lightness: Expected 1 to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $lightness: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/chroma/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $chroma: 1)} + +<===> none/chroma/error +Error: $chroma: Expected 1 to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $chroma: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/lightness/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $lightness: 1px)} + +<===> wrong/lightness/error +Error: $lightness: Expected 1px to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $lightness: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/chroma/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $chroma: 1px)} + +<===> wrong/chroma/error +Error: $chroma: Expected 1px to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $chroma: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/oklab.hrx b/spec/core_functions/color/scale/error/units/oklab.hrx new file mode 100644 index 0000000000..6d173c1b1d --- /dev/null +++ b/spec/core_functions/color/scale/error/units/oklab.hrx @@ -0,0 +1,81 @@ +<===> none/lightness/input.scss +@use "sass:color"; +a {b: color.scale(oklab(50% 40% -20%), $lightness: 1)} + +<===> none/lightness/error +Error: $lightness: Expected 1 to have unit "%". + , +2 | a {b: color.scale(oklab(50% 40% -20%), $lightness: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/a/input.scss +@use "sass:color"; +a {b: color.scale(oklab(50% 40% -20%), $a: 1)} + +<===> none/a/error +Error: $a: Expected 1 to have unit "%". + , +2 | a {b: color.scale(oklab(50% 40% -20%), $a: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/b/input.scss +@use "sass:color"; +a {b: color.scale(oklab(50% 40% -20%), $b: 1)} + +<===> none/b/error +Error: $b: Expected 1 to have unit "%". + , +2 | a {b: color.scale(oklab(50% 40% -20%), $b: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/lightness/input.scss +@use "sass:color"; +a {b: color.scale(oklab(50% 40% -20%), $lightness: 1px)} + +<===> wrong/lightness/error +Error: $lightness: Expected 1px to have unit "%". + , +2 | a {b: color.scale(oklab(50% 40% -20%), $lightness: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/a/input.scss +@use "sass:color"; +a {b: color.scale(oklab(50% 40% -20%), $a: 1px)} + +<===> wrong/a/error +Error: $a: Expected 1px to have unit "%". + , +2 | a {b: color.scale(oklab(50% 40% -20%), $a: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/b/input.scss +@use "sass:color"; +a {b: color.scale(oklab(50% 40% -20%), $b: 1px)} + +<===> wrong/b/error +Error: $b: Expected 1px to have unit "%". + , +2 | a {b: color.scale(oklab(50% 40% -20%), $b: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/oklch.hrx b/spec/core_functions/color/scale/error/units/oklch.hrx new file mode 100644 index 0000000000..fc3c27d3d4 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/oklch.hrx @@ -0,0 +1,53 @@ +<===> none/lightness/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $lightness: 1)} + +<===> none/lightness/error +Error: $lightness: Expected 1 to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $lightness: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/chroma/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $chroma: 1)} + +<===> none/chroma/error +Error: $chroma: Expected 1 to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $chroma: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/lightness/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $lightness: 1px)} + +<===> wrong/lightness/error +Error: $lightness: Expected 1px to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $lightness: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/chroma/input.scss +@use "sass:color"; +a {b: color.scale(lch(30% 70% 200deg), $chroma: 1px)} + +<===> wrong/chroma/error +Error: $chroma: Expected 1px to have unit "%". + , +2 | a {b: color.scale(lch(30% 70% 200deg), $chroma: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/prophoto_rgb.hrx b/spec/core_functions/color/scale/error/units/prophoto_rgb.hrx new file mode 100644 index 0000000000..8078d52e35 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/prophoto_rgb.hrx @@ -0,0 +1,81 @@ +<===> none/red/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: 1)} + +<===> none/red/error +Error: $red: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/green/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: 1)} + +<===> none/green/error +Error: $green: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: 1)} + +<===> none/blue/error +Error: $blue: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/red/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: 1px)} + +<===> wrong/red/error +Error: $red: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/green/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: 1px)} + +<===> wrong/green/error +Error: $green: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: 1px)} + +<===> wrong/blue/error +Error: $blue: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/rec2020.hrx b/spec/core_functions/color/scale/error/units/rec2020.hrx new file mode 100644 index 0000000000..3fc9090ab4 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/rec2020.hrx @@ -0,0 +1,81 @@ +<===> none/red/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: 1)} + +<===> none/red/error +Error: $red: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/green/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: 1)} + +<===> none/green/error +Error: $green: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: 1)} + +<===> none/blue/error +Error: $blue: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/red/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: 1px)} + +<===> wrong/red/error +Error: $red: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/green/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: 1px)} + +<===> wrong/green/error +Error: $green: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: 1px)} + +<===> wrong/blue/error +Error: $blue: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/rgb.hrx b/spec/core_functions/color/scale/error/units/rgb.hrx new file mode 100644 index 0000000000..d8b90585c6 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/rgb.hrx @@ -0,0 +1,81 @@ +<===> none/red/input.scss +@use "sass:color"; +a {b: color.scale(white, $red: 1)} + +<===> none/red/error +Error: $red: Expected 1 to have unit "%". + , +2 | a {b: color.scale(white, $red: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/green/input.scss +@use "sass:color"; +a {b: color.scale(white, $green: 1)} + +<===> none/green/error +Error: $green: Expected 1 to have unit "%". + , +2 | a {b: color.scale(white, $green: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blue/input.scss +@use "sass:color"; +a {b: color.scale(white, $blue: 1)} + +<===> none/blue/error +Error: $blue: Expected 1 to have unit "%". + , +2 | a {b: color.scale(white, $blue: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/red/input.scss +@use "sass:color"; +a {b: color.scale(white, $red: 1px)} + +<===> wrong/red/error +Error: $red: Expected 1px to have unit "%". + , +2 | a {b: color.scale(white, $red: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/green/input.scss +@use "sass:color"; +a {b: color.scale(white, $green: 1px)} + +<===> wrong/green/error +Error: $green: Expected 1px to have unit "%". + , +2 | a {b: color.scale(white, $green: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blue/input.scss +@use "sass:color"; +a {b: color.scale(white, $blue: 1px)} + +<===> wrong/blue/error +Error: $blue: Expected 1px to have unit "%". + , +2 | a {b: color.scale(white, $blue: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/srgb.hrx b/spec/core_functions/color/scale/error/units/srgb.hrx new file mode 100644 index 0000000000..a60db7d908 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/srgb.hrx @@ -0,0 +1,81 @@ +<===> none/red/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: 1)} + +<===> none/red/error +Error: $red: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/green/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: 1)} + +<===> none/green/error +Error: $green: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: 1)} + +<===> none/blue/error +Error: $blue: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/red/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: 1px)} + +<===> wrong/red/error +Error: $red: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/green/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: 1px)} + +<===> wrong/green/error +Error: $green: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: 1px)} + +<===> wrong/blue/error +Error: $blue: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/srgb_linear.hrx b/spec/core_functions/color/scale/error/units/srgb_linear.hrx new file mode 100644 index 0000000000..92292b25ad --- /dev/null +++ b/spec/core_functions/color/scale/error/units/srgb_linear.hrx @@ -0,0 +1,81 @@ +<===> none/red/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: 1)} + +<===> none/red/error +Error: $red: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/green/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: 1)} + +<===> none/green/error +Error: $green: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: 1)} + +<===> none/blue/error +Error: $blue: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/red/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: 1px)} + +<===> wrong/red/error +Error: $red: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/green/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: 1px)} + +<===> wrong/green/error +Error: $green: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/blue/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: 1px)} + +<===> wrong/blue/error +Error: $blue: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/xyz_d50.hrx b/spec/core_functions/color/scale/error/units/xyz_d50.hrx new file mode 100644 index 0000000000..a42bbf4f73 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/xyz_d50.hrx @@ -0,0 +1,81 @@ +<===> none/x/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 1)} + +<===> none/x/error +Error: $x: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/y/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: 1)} + +<===> none/y/error +Error: $y: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/z/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: 1)} + +<===> none/z/error +Error: $z: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/x/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 1px)} + +<===> wrong/x/error +Error: $x: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/y/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: 1px)} + +<===> wrong/y/error +Error: $y: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/z/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: 1px)} + +<===> wrong/z/error +Error: $z: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/error/units/xyz_d65.hrx b/spec/core_functions/color/scale/error/units/xyz_d65.hrx new file mode 100644 index 0000000000..327ccbecf5 --- /dev/null +++ b/spec/core_functions/color/scale/error/units/xyz_d65.hrx @@ -0,0 +1,81 @@ +<===> none/x/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 1)} + +<===> none/x/error +Error: $x: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/y/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: 1)} + +<===> none/y/error +Error: $y: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> none/z/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: 1)} + +<===> none/z/error +Error: $z: Expected 1 to have unit "%". + , +2 | a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/x/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 1px)} + +<===> wrong/x/error +Error: $x: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/y/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: 1px)} + +<===> wrong/y/error +Error: $y: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong/z/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: 1px)} + +<===> wrong/z/error +Error: $z: Expected 1px to have unit "%". + , +2 | a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: 1px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale/global.hrx b/spec/core_functions/color/scale/global.hrx new file mode 100644 index 0000000000..ce1704d54a --- /dev/null +++ b/spec/core_functions/color/scale/global.hrx @@ -0,0 +1,17 @@ +<===> legacy/input.scss +a {b: scale-color(pink, $blue: 20%)} + +<===> legacy/output.css +a { + b: rgb(255, 192, 213.4); +} + +<===> +================================================================================ +<===> non_legacy/input.scss +a {b: scale-color(pink, $chroma: -10%, $space: oklch)} + +<===> non_legacy/output.css +a { + b: rgb(250.9720040643, 194.0861924561, 203.8303793932); +} diff --git a/spec/core_functions/color/scale_color/hsl.hrx b/spec/core_functions/color/scale/hsl.hrx similarity index 88% rename from spec/core_functions/color/scale_color/hsl.hrx rename to spec/core_functions/color/scale/hsl.hrx index bebb7a5704..81d24de9ac 100644 --- a/spec/core_functions/color/scale_color/hsl.hrx +++ b/spec/core_functions/color/scale/hsl.hrx @@ -26,7 +26,7 @@ a {b: color.scale(plum, $saturation: -100%)} <===> saturation/min/output.css a { - b: #bfbfbf; + b: rgb(190.5, 190.5, 190.5); } <===> @@ -37,7 +37,7 @@ a {b: color.scale(plum, $saturation: 67%)} <===> saturation/high/output.css a { - b: #f489f4; + b: rgb(243.78, 137.22, 243.78); } <===> @@ -48,7 +48,7 @@ a {b: color.scale(plum, $saturation: -43%)} <===> saturation/low/output.css a { - b: #d0add0; + b: rgb(207.885, 173.115, 207.885); } <===> @@ -92,7 +92,7 @@ a {b: color.scale(red, $lightness: 94%)} <===> lightness/high/output.css a { - b: #fff0f0; + b: rgb(255, 239.7, 239.7); } <===> @@ -103,7 +103,7 @@ a {b: color.scale(red, $lightness: -14%)} <===> lightness/low/output.css a { - b: #db0000; + b: rgb(219.3, 0, 0); } <===> @@ -114,7 +114,7 @@ a {b: color.scale(turquoise, $saturation: 24%, $lightness: -48%)} <===> all/output.css a { - b: #10867a; + b: rgb(15.8934486486, 133.8665513514, 122.0692410811); } <===> @@ -125,7 +125,7 @@ a {b: color.scale(rgba(turquoise, 0.7), $saturation: 24%, $lightness: -48%)} <===> alpha_input/output.css a { - b: rgba(16, 134, 122, 0.7); + b: rgba(15.8934486486, 133.8665513514, 122.0692410811, 0.7); } <===> @@ -136,7 +136,7 @@ a {b: color.scale(turquoise, $saturation: 24%, $lightness: -48%, $alpha: -70%)} <===> alpha_arg/output.css a { - b: rgba(16, 134, 122, 0.3); + b: rgba(15.8934486486, 133.8665513514, 122.0692410811, 0.3); } <===> @@ -147,5 +147,5 @@ a {b: color.scale($color: turquoise, $saturation: 24%, $lightness: -48%)} <===> named/output.css a { - b: #10867a; + b: rgb(15.8934486486, 133.8665513514, 122.0692410811); } diff --git a/spec/core_functions/color/scale_color/hwb.hrx b/spec/core_functions/color/scale/hwb.hrx similarity index 91% rename from spec/core_functions/color/scale_color/hwb.hrx rename to spec/core_functions/color/scale/hwb.hrx index 042cee6be1..28bf63f782 100644 --- a/spec/core_functions/color/scale_color/hwb.hrx +++ b/spec/core_functions/color/scale/hwb.hrx @@ -4,7 +4,7 @@ a {b: color.scale(#66cc99, $whiteness: 100%)} <===> whiteness/max/output.css a { - b: #d5d5d5; + b: rgb(212.5, 212.5, 212.5); } <===> @@ -37,7 +37,7 @@ a {b: color.scale(#33cc80, $whiteness: 50%)} <===> whiteness/high/output.css a { - b: #99ccb3; + b: rgb(153, 204, 178.6666666667); } <===> @@ -48,7 +48,7 @@ a {b: color.scale(#66cc99, $whiteness: -50%)} <===> whiteness/low/output.css a { - b: #33cc80; + b: rgb(51, 204, 127.5); } <===> @@ -59,7 +59,7 @@ a {b: color.scale(#339966, $blackness: 100%)} <===> blackness/max/output.css a { - b: #2b2b2b; + b: rgb(42.5, 42.5, 42.5); } <===> @@ -92,7 +92,7 @@ a {b: color.scale(#33cc80, $blackness: 50%)} <===> blackness/high/output.css a { - b: #33664d; + b: rgb(51, 102, 76.6666666667); } <===> @@ -103,7 +103,7 @@ a {b: color.scale(#339966, $blackness: -50%)} <===> blackness/low/output.css a { - b: #33cc80; + b: rgb(51, 204, 127.5); } <===> @@ -114,7 +114,7 @@ a {b: color.scale(#66cc99, $whiteness: -50%, $blackness: 50%)} <===> all/output.css a { - b: #33664d; + b: rgb(51, 102, 76.5); } <===> @@ -125,7 +125,7 @@ a {b: color.scale(rgba(#66cc99, 0.7), $whiteness: -50%, $blackness: 50%)} <===> alpha_input/output.css a { - b: rgba(51, 102, 77, 0.7); + b: rgba(51, 102, 76.5, 0.7); } <===> @@ -136,7 +136,7 @@ a {b: color.scale(#66cc99, $whiteness: -50%, $blackness: 50%, $alpha: -70%)} <===> alpha_arg/output.css a { - b: rgba(51, 102, 77, 0.3); + b: rgba(51, 102, 76.5, 0.3); } <===> @@ -147,5 +147,5 @@ a {b: color.scale($color: #66cc99, $whiteness: -50%, $blackness: 50%)} <===> named/output.css a { - b: #33664d; + b: rgb(51, 102, 76.5); } diff --git a/spec/core_functions/color/change_color/hsl.hrx b/spec/core_functions/color/scale/lab.hrx similarity index 54% rename from spec/core_functions/color/change_color/hsl.hrx rename to spec/core_functions/color/scale/lab.hrx index 3f65e0a8f1..730debbc66 100644 --- a/spec/core_functions/color/change_color/hsl.hrx +++ b/spec/core_functions/color/scale/lab.hrx @@ -1,206 +1,217 @@ -<===> hue/max/input.scss +<===> lightness/max/input.scss @use "sass:color"; -a {b: color.change(red, $hue: 359)} +a {b: color.scale(lab(70% 100 -60), $lightness: 100%)} -<===> hue/max/output.css +<===> lightness/max/output.css a { - b: #ff0004; + b: lab(100% 100 -60); } <===> ================================================================================ -<===> hue/above_max/input.scss +<===> lightness/min/input.scss @use "sass:color"; -a {b: color.change(red, $hue: 540)} +a {b: color.scale(lab(70% 100 -60), $lightness: -100%)} -<===> hue/above_max/output.css +<===> lightness/min/output.css a { - b: aqua; + b: lab(0% 100 -60); } <===> ================================================================================ -<===> hue/min/input.scss +<===> lightness/zero/input.scss @use "sass:color"; -a {b: color.change(blue, $hue: 0)} +a {b: color.scale(lab(70% 100 -60), $lightness: 0%)} -<===> hue/min/output.css +<===> lightness/zero/output.css a { - b: red; + b: lab(70% 100 -60); } <===> ================================================================================ -<===> hue/negative/input.scss +<===> lightness/low/input.scss @use "sass:color"; -a {b: color.change(red, $hue: -60)} +a {b: color.scale(lab(70% 100 -60), $lightness: -33%)} -<===> hue/negative/output.css +<===> lightness/low/output.css a { - b: fuchsia; + b: lab(46.9% 100 -60); } <===> ================================================================================ -<===> hue/middle/input.scss +<===> lightness/high/input.scss @use "sass:color"; -a {b: color.change(red, $hue: 123)} +a {b: color.scale(lab(70% 100 -60), $lightness: 86%)} -<===> hue/middle/output.css +<===> lightness/high/output.css a { - b: #00ff0d; + b: lab(95.8% 100 -60); } <===> ================================================================================ -<===> hue/fraction/input.scss +<===> a/max/input.scss @use "sass:color"; -a {b: color.change(red, $hue: 0.5)} +a {b: color.scale(lab(70% 100 -60), $a: 100%)} -<===> hue/fraction/output.css +<===> a/max/output.css a { - b: #ff0200; + b: lab(70% 125 -60); } <===> ================================================================================ -<===> saturation/max/input.scss +<===> a/min/input.scss @use "sass:color"; -a {b: color.change(plum, $saturation: 100%)} +a {b: color.scale(lab(70% 100 -60), $a: -100%)} -<===> saturation/max/output.css +<===> a/min/output.css a { - b: #ff7eff; + b: lab(70% -125 -60); } <===> ================================================================================ -<===> saturation/min/input.scss +<===> a/zero/input.scss @use "sass:color"; -a {b: color.change(plum, $saturation: 0%)} +a {b: color.scale(lab(70% 100 -60), $a: 0%)} -<===> saturation/min/output.css +<===> a/zero/output.css a { - b: #bfbfbf; + b: lab(70% 100 -60); } <===> ================================================================================ -<===> saturation/high/input.scss +<===> a/low/input.scss @use "sass:color"; -a {b: color.change(plum, $saturation: 76%)} +a {b: color.scale(lab(70% 100 -60), $a: -86%)} -<===> saturation/high/output.css +<===> a/low/output.css a { - b: #f08df0; + b: lab(70% -93.5 -60); } <===> ================================================================================ -<===> saturation/low/input.scss +<===> a/high/input.scss @use "sass:color"; -a {b: color.change(plum, $saturation: 14%)} +a {b: color.scale(lab(70% 100 -60), $a: 12%)} -<===> saturation/low/output.css +<===> a/high/output.css a { - b: #c8b5c8; + b: lab(70% 103 -60); } <===> ================================================================================ -<===> lightness/max/input.scss +<===> b/max/input.scss @use "sass:color"; -a {b: color.change(red, $lightness: 100%)} +a {b: color.scale(lab(70% 100 -60), $b: 100%)} -<===> lightness/max/output.css +<===> b/max/output.css a { - b: white; + b: lab(70% 100 125); } <===> ================================================================================ -<===> lightness/fraction/input.scss +<===> b/min/input.scss @use "sass:color"; -a {b: color.change(red, $lightness: 0.5%)} +a {b: color.scale(lab(70% 100 -60), $b: -100%)} -<===> lightness/fraction/output.css +<===> b/min/output.css a { - b: #030000; + b: lab(70% 100 -125); } <===> ================================================================================ -<===> lightness/min/input.scss +<===> b/zero/input.scss @use "sass:color"; -a {b: color.change(red, $lightness: 0%)} +a {b: color.scale(lab(70% 100 -60), $b: 0%)} -<===> lightness/min/output.css +<===> b/zero/output.css a { - b: black; + b: lab(70% 100 -60); } <===> ================================================================================ -<===> lightness/high/input.scss +<===> b/low/input.scss @use "sass:color"; -a {b: color.change(red, $lightness: 63%)} +a {b: color.scale(lab(70% 100 -60), $b: -16%)} -<===> lightness/high/output.css +<===> b/low/output.css a { - b: #ff4242; + b: lab(70% 100 -70.4); } <===> ================================================================================ -<===> lightness/low/input.scss +<===> b/high/input.scss @use "sass:color"; -a {b: color.change(red, $lightness: 27%)} +a {b: color.scale(lab(70% 100 -60), $b: 42%)} -<===> lightness/low/output.css +<===> b/high/output.css a { - b: #8a0000; + b: lab(70% 100 17.7); } <===> ================================================================================ <===> all/input.scss @use "sass:color"; -a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%)} +a { + b: color.scale(lab(70% 100 -60), $lightness: 12%, $a: 24%, $b: 48%); +} <===> all/output.css a { - b: #98695d; + b: lab(73.6% 106 28.8); } <===> ================================================================================ <===> alpha_input/input.scss @use "sass:color"; -a {b: color.change(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} +a { + b: color.scale(lab(70% 100 -60 / 0.3), $lightness: 12%, $a: 24%, $b: 48%); +} <===> alpha_input/output.css a { - b: rgba(152, 105, 93, 0.7); + b: lab(73.6% 106 28.8 / 0.3); } <===> ================================================================================ <===> alpha_arg/input.scss @use "sass:color"; -a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} +a { + b: color.scale( + lab(70% 100 -60), + $lightness: 12%, $a: 24%, $b: 48%, $alpha: -70% + ); +} <===> alpha_arg/output.css a { - b: rgba(152, 105, 93, 0.7); + b: lab(73.6% 106 28.8 / 0.3); } <===> ================================================================================ <===> named/input.scss @use "sass:color"; -a {b: color.change($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} +a { + b: color.scale($color: lab(70% 100 -60), $lightness: 12%, $a: 24%, $b: 48%); +} <===> named/output.css a { - b: #98695d; + b: lab(73.6% 106 28.8); } diff --git a/spec/core_functions/color/scale/lch.hrx b/spec/core_functions/color/scale/lch.hrx new file mode 100644 index 0000000000..de5e4bfc0c --- /dev/null +++ b/spec/core_functions/color/scale/lch.hrx @@ -0,0 +1,158 @@ +<===> lightness/max/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $lightness: 100%)} + +<===> lightness/max/output.css +a { + b: lch(100% 30 80deg); +} + +<===> +================================================================================ +<===> lightness/min/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $lightness: -100%)} + +<===> lightness/min/output.css +a { + b: lch(0% 30 80deg); +} + +<===> +================================================================================ +<===> lightness/zero/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $lightness: 0%)} + +<===> lightness/zero/output.css +a { + b: lch(70% 30 80deg); +} + +<===> +================================================================================ +<===> lightness/low/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $lightness: -33%)} + +<===> lightness/low/output.css +a { + b: lch(46.9% 30 80deg); +} + +<===> +================================================================================ +<===> lightness/high/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $lightness: 86%)} + +<===> lightness/high/output.css +a { + b: lch(95.8% 30 80deg); +} + +<===> +================================================================================ +<===> chroma/max/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $chroma: 100%)} + +<===> chroma/max/output.css +a { + b: lch(70% 150 80deg); +} + +<===> +================================================================================ +<===> chroma/min/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $chroma: -100%)} + +<===> chroma/min/output.css +a { + b: lch(70% 0 80deg); +} + +<===> +================================================================================ +<===> chroma/zero/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $chroma: 0%)} + +<===> chroma/zero/output.css +a { + b: lch(70% 30 80deg); +} + +<===> +================================================================================ +<===> chroma/low/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $chroma: -86%)} + +<===> chroma/low/output.css +a { + b: lch(70% 4.2 80deg); +} + +<===> +================================================================================ +<===> chroma/high/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $chroma: 12%)} + +<===> chroma/high/output.css +a { + b: lch(70% 44.4 80deg); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a {b: color.scale(lch(70% 20% 80deg), $lightness: 12%, $chroma: 24%)} + +<===> all/output.css +a { + b: lch(73.6% 58.8 80deg); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale(lch(70% 20% 80deg / 0.3), $lightness: 12%, $chroma: 24%); +} + +<===> alpha_input/output.css +a { + b: lch(73.6% 58.8 80deg / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + lch(70% 20% 80deg), + $lightness: 12%, $chroma: 24%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: lch(73.6% 58.8 80deg / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.scale($color: lch(70% 20% 80deg), $lightness: 12%, $chroma: 24%)} + +<===> named/output.css +a { + b: lch(73.6% 58.8 80deg); +} diff --git a/spec/core_functions/color/scale/no_channels.hrx b/spec/core_functions/color/scale/no_channels.hrx new file mode 100644 index 0000000000..b3c20aa395 --- /dev/null +++ b/spec/core_functions/color/scale/no_channels.hrx @@ -0,0 +1,30 @@ +<===> identical/input.scss +@use "sass:color"; +a {b: color.scale(oklch(50% 0.2 0deg), $space: lab)} + +<===> identical/output.css +a { + b: oklch(50% 0.2 0deg); +} + +<===> +================================================================================ +<===> powerless/input.scss +@use "sass:color"; +a {b: color.scale(oklch(50% 0 0deg), $space: lab)} + +<===> powerless/output.css +a { + b: oklch(50% 0 none); +} + +<===> +================================================================================ +<===> missing/input.scss +@use "sass:color"; +a {b: color.scale(rgb(none none none))} + +<===> missing/output.css +a { + b: rgb(none none none); +} diff --git a/spec/core_functions/color/scale_color/no_rgb_hsl.hrx b/spec/core_functions/color/scale/no_space.hrx similarity index 100% rename from spec/core_functions/color/scale_color/no_rgb_hsl.hrx rename to spec/core_functions/color/scale/no_space.hrx diff --git a/spec/core_functions/color/scale/oklab.hrx b/spec/core_functions/color/scale/oklab.hrx new file mode 100644 index 0000000000..8b48035794 --- /dev/null +++ b/spec/core_functions/color/scale/oklab.hrx @@ -0,0 +1,217 @@ +<===> lightness/max/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $lightness: 100%)} + +<===> lightness/max/output.css +a { + b: oklab(100% 0.3 -0.25); +} + +<===> +================================================================================ +<===> lightness/min/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $lightness: -100%)} + +<===> lightness/min/output.css +a { + b: oklab(0% 0.3 -0.25); +} + +<===> +================================================================================ +<===> lightness/zero/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $lightness: 0%)} + +<===> lightness/zero/output.css +a { + b: oklab(70% 0.3 -0.25); +} + +<===> +================================================================================ +<===> lightness/low/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $lightness: -33%)} + +<===> lightness/low/output.css +a { + b: oklab(46.9% 0.3 -0.25); +} + +<===> +================================================================================ +<===> lightness/high/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $lightness: 86%)} + +<===> lightness/high/output.css +a { + b: oklab(95.8% 0.3 -0.25); +} + +<===> +================================================================================ +<===> a/max/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $a: 100%)} + +<===> a/max/output.css +a { + b: oklab(70% 0.4 -0.25); +} + +<===> +================================================================================ +<===> a/min/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $a: -100%)} + +<===> a/min/output.css +a { + b: oklab(70% -0.4 -0.25); +} + +<===> +================================================================================ +<===> a/zero/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $a: 0%)} + +<===> a/zero/output.css +a { + b: oklab(70% 0.3 -0.25); +} + +<===> +================================================================================ +<===> a/low/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $a: -86%)} + +<===> a/low/output.css +a { + b: oklab(70% -0.302 -0.25); +} + +<===> +================================================================================ +<===> a/high/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $a: 12%)} + +<===> a/high/output.css +a { + b: oklab(70% 0.312 -0.25); +} + +<===> +================================================================================ +<===> b/max/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $b: 100%)} + +<===> b/max/output.css +a { + b: oklab(70% 0.3 0.4); +} + +<===> +================================================================================ +<===> b/min/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $b: -100%)} + +<===> b/min/output.css +a { + b: oklab(70% 0.3 -0.4); +} + +<===> +================================================================================ +<===> b/zero/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $b: 0%)} + +<===> b/zero/output.css +a { + b: oklab(70% 0.3 -0.25); +} + +<===> +================================================================================ +<===> b/low/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $b: -16%)} + +<===> b/low/output.css +a { + b: oklab(70% 0.3 -0.274); +} + +<===> +================================================================================ +<===> b/high/input.scss +@use "sass:color"; +a {b: color.scale(oklab(70% 0.3 -0.25), $b: 42%)} + +<===> b/high/output.css +a { + b: oklab(70% 0.3 0.023); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale(oklab(70% 0.3 -0.25), $lightness: 12%, $a: 24%, $b: 48%); +} + +<===> all/output.css +a { + b: oklab(73.6% 0.324 0.062); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale(oklab(70% 0.3 -0.25 / 0.3), $lightness: 12%, $a: 24%, $b: 48%); +} + +<===> alpha_input/output.css +a { + b: oklab(73.6% 0.324 0.062 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + oklab(70% 0.3 -0.25), + $lightness: 12%, $a: 24%, $b: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: oklab(73.6% 0.324 0.062 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale($color: oklab(70% 0.3 -0.25), $lightness: 12%, $a: 24%, $b: 48%); +} + +<===> named/output.css +a { + b: oklab(73.6% 0.324 0.062); +} diff --git a/spec/core_functions/color/scale/out_of_gamut.hrx b/spec/core_functions/color/scale/out_of_gamut.hrx new file mode 100644 index 0000000000..b53c3b18fb --- /dev/null +++ b/spec/core_functions/color/scale/out_of_gamut.hrx @@ -0,0 +1,41 @@ +<===> above_gamut/up/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 1.2 0.5 0.7), $red: 10%)} + +<===> above_gamut/up/output.css +a { + b: color(srgb 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> above_gamut/down/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb 1.2 0.5 0.7), $red: -10%)} + +<===> above_gamut/down/output.css +a { + b: color(srgb 1.08 0.5 0.7); +} + +<===> +================================================================================ +<===> below_gamut/up/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb -0.5 0.5 0.7), $red: 10%)} + +<===> below_gamut/up/output.css +a { + b: color(srgb -0.35 0.5 0.7); +} + +<===> +================================================================================ +<===> below_gamut/down/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb -0.5 0.5 0.7), $red: -10%)} + +<===> below_gamut/down/output.css +a { + b: color(srgb -0.5 0.5 0.7); +} diff --git a/spec/core_functions/color/scale/prophoto_rgb.hrx b/spec/core_functions/color/scale/prophoto_rgb.hrx new file mode 100644 index 0000000000..e9ec44ead2 --- /dev/null +++ b/spec/core_functions/color/scale/prophoto_rgb.hrx @@ -0,0 +1,225 @@ +<===> red/max/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: 100%)} + +<===> red/max/output.css +a { + b: color(prophoto-rgb 1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/min/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: -100%)} + +<===> red/min/output.css +a { + b: color(prophoto-rgb 0 0.5 0.7); +} + +<===> +================================================================================ +<===> red/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: 0%)} + +<===> red/zero/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/low/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: -33%)} + +<===> red/low/output.css +a { + b: color(prophoto-rgb 0.134 0.5 0.7); +} + +<===> +================================================================================ +<===> red/high/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $red: 86%)} + +<===> red/high/output.css +a { + b: color(prophoto-rgb 0.888 0.5 0.7); +} + +<===> +================================================================================ +<===> green/max/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: 100%)} + +<===> green/max/output.css +a { + b: color(prophoto-rgb 0.2 1 0.7); +} + +<===> +================================================================================ +<===> green/min/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: -100%)} + +<===> green/min/output.css +a { + b: color(prophoto-rgb 0.2 0 0.7); +} + +<===> +================================================================================ +<===> green/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: 0%)} + +<===> green/zero/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/low/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: -86%)} + +<===> green/low/output.css +a { + b: color(prophoto-rgb 0.2 0.07 0.7); +} + +<===> +================================================================================ +<===> green/high/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $green: 12%)} + +<===> green/high/output.css +a { + b: color(prophoto-rgb 0.2 0.56 0.7); +} + +<===> +================================================================================ +<===> blue/max/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: 100%)} + +<===> blue/max/output.css +a { + b: color(prophoto-rgb 0.2 0.5 1); +} + +<===> +================================================================================ +<===> blue/min/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: -100%)} + +<===> blue/min/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0); +} + +<===> +================================================================================ +<===> blue/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0%)} + +<===> blue/zero/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> blue/low/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: -16%)} + +<===> blue/low/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.588); +} + +<===> +================================================================================ +<===> blue/high/input.scss +@use "sass:color"; +a {b: color.scale(color(prophoto-rgb 0.2 0.5 0.7), $blue: 42%)} + +<===> blue/high/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.826); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale( + color(prophoto-rgb 0.2 0.5 0.7), $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> all/output.css +a { + b: color(prophoto-rgb 0.296 0.62 0.844); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale( + color(prophoto-rgb 0.2 0.5 0.7 / 0.3), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> alpha_input/output.css +a { + b: color(prophoto-rgb 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + color(prophoto-rgb 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: color(prophoto-rgb 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale( + $color: color(prophoto-rgb 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> named/output.css +a { + b: color(prophoto-rgb 0.296 0.62 0.844); +} diff --git a/spec/core_functions/color/scale/rec2020.hrx b/spec/core_functions/color/scale/rec2020.hrx new file mode 100644 index 0000000000..68ba4dc093 --- /dev/null +++ b/spec/core_functions/color/scale/rec2020.hrx @@ -0,0 +1,225 @@ +<===> red/max/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: 100%)} + +<===> red/max/output.css +a { + b: color(rec2020 1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/min/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: -100%)} + +<===> red/min/output.css +a { + b: color(rec2020 0 0.5 0.7); +} + +<===> +================================================================================ +<===> red/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: 0%)} + +<===> red/zero/output.css +a { + b: color(rec2020 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/low/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: -33%)} + +<===> red/low/output.css +a { + b: color(rec2020 0.134 0.5 0.7); +} + +<===> +================================================================================ +<===> red/high/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $red: 86%)} + +<===> red/high/output.css +a { + b: color(rec2020 0.888 0.5 0.7); +} + +<===> +================================================================================ +<===> green/max/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: 100%)} + +<===> green/max/output.css +a { + b: color(rec2020 0.2 1 0.7); +} + +<===> +================================================================================ +<===> green/min/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: -100%)} + +<===> green/min/output.css +a { + b: color(rec2020 0.2 0 0.7); +} + +<===> +================================================================================ +<===> green/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: 0%)} + +<===> green/zero/output.css +a { + b: color(rec2020 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/low/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: -86%)} + +<===> green/low/output.css +a { + b: color(rec2020 0.2 0.07 0.7); +} + +<===> +================================================================================ +<===> green/high/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $green: 12%)} + +<===> green/high/output.css +a { + b: color(rec2020 0.2 0.56 0.7); +} + +<===> +================================================================================ +<===> blue/max/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: 100%)} + +<===> blue/max/output.css +a { + b: color(rec2020 0.2 0.5 1); +} + +<===> +================================================================================ +<===> blue/min/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: -100%)} + +<===> blue/min/output.css +a { + b: color(rec2020 0.2 0.5 0); +} + +<===> +================================================================================ +<===> blue/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: 0%)} + +<===> blue/zero/output.css +a { + b: color(rec2020 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> blue/low/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: -16%)} + +<===> blue/low/output.css +a { + b: color(rec2020 0.2 0.5 0.588); +} + +<===> +================================================================================ +<===> blue/high/input.scss +@use "sass:color"; +a {b: color.scale(color(rec2020 0.2 0.5 0.7), $blue: 42%)} + +<===> blue/high/output.css +a { + b: color(rec2020 0.2 0.5 0.826); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale( + color(rec2020 0.2 0.5 0.7), $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> all/output.css +a { + b: color(rec2020 0.296 0.62 0.844); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale( + color(rec2020 0.2 0.5 0.7 / 0.3), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> alpha_input/output.css +a { + b: color(rec2020 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + color(rec2020 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: color(rec2020 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale( + $color: color(rec2020 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> named/output.css +a { + b: color(rec2020 0.296 0.62 0.844); +} diff --git a/spec/core_functions/color/scale_color/rgb.hrx b/spec/core_functions/color/scale/rgb.hrx similarity index 93% rename from spec/core_functions/color/scale_color/rgb.hrx rename to spec/core_functions/color/scale/rgb.hrx index 33141a026e..5864fa88f9 100644 --- a/spec/core_functions/color/scale_color/rgb.hrx +++ b/spec/core_functions/color/scale/rgb.hrx @@ -37,7 +37,7 @@ a {b: color.scale(lightcoral, $red: -33%)} <===> red/low/output.css a { - b: #a18080; + b: rgb(160.8, 128, 128); } <===> @@ -48,7 +48,7 @@ a {b: color.scale(turquoise, $red: 86%)} <===> red/high/output.css a { - b: #e4e0d0; + b: rgb(228.26, 224, 208); } <===> @@ -92,7 +92,7 @@ a {b: color.scale(seagreen, $green: -86%)} <===> green/low/output.css a { - b: #2e1357; + b: rgb(46, 19.46, 87); } <===> @@ -103,7 +103,7 @@ a {b: color.scale(cadetblue, $green: 12%)} <===> green/high/output.css a { - b: #5faaa0; + b: rgb(95, 169.64, 160); } <===> @@ -147,7 +147,7 @@ a {b: color.scale(slategray, $blue: -16%)} <===> blue/low/output.css a { - b: #708079; + b: rgb(112, 128, 120.96); } <===> @@ -158,7 +158,7 @@ a {b: color.scale(salmon, $blue: 42%)} <===> blue/high/output.css a { - b: #fa80ad; + b: rgb(250, 128, 173.22); } <===> @@ -169,7 +169,7 @@ a {b: color.scale(sienna, $red: 12%, $green: 24%, $blue: 48%)} <===> all/output.css a { - b: #ab7c92; + b: rgb(171.4, 123.52, 145.8); } <===> @@ -180,7 +180,7 @@ a {b: color.scale(rgba(sienna, 0.3), $red: 12%, $green: 24%, $blue: 48%)} <===> alpha_input/output.css a { - b: rgba(171, 124, 146, 0.3); + b: rgba(171.4, 123.52, 145.8, 0.3); } <===> @@ -191,7 +191,7 @@ a {b: color.scale(sienna, $red: 12%, $green: 24%, $blue: 48%, $alpha: -70%)} <===> alpha_arg/output.css a { - b: rgba(171, 124, 146, 0.3); + b: rgba(171.4, 123.52, 145.8, 0.3); } <===> @@ -202,5 +202,5 @@ a {b: color.scale($color: sienna, $red: 12%, $green: 24%, $blue: 48%)} <===> named/output.css a { - b: #ab7c92; + b: rgb(171.4, 123.52, 145.8); } diff --git a/spec/core_functions/color/scale/space.hrx b/spec/core_functions/color/scale/space.hrx new file mode 100644 index 0000000000..de91dcf6c3 --- /dev/null +++ b/spec/core_functions/color/scale/space.hrx @@ -0,0 +1,140 @@ +<===> legacy/to_legacy/input.scss +@use "sass:color"; +a {b: color.scale(red, $saturation: -10%, $space: hsl)} + +<===> legacy/to_legacy/output.css +a { + b: rgb(242.25, 12.75, 12.75); +} + +<===> +================================================================================ +<===> legacy/to_modern/input.scss +@use "sass:color"; +a {b: color.scale(red, $a: 10%, $space: lab)} + +<===> legacy/to_modern/output.css +a { + b: hsl(352.5777091359, 128.657405446%, 44.6392534152%); +} + +<===> +================================================================================ +<===> modern/to_legacy/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 10 -20), $saturation: -20%, $space: hsl)} + +<===> modern/to_legacy/output.css +a { + b: lab(51.1280465895% 7.8762091679 -15.9907381545); +} + +<===> +================================================================================ +<===> modern/to_modern/input.scss +@use "sass:color"; +a {b: color.scale(lab(50% 10 -20), $chroma: 20%, $space: oklch)} + +<===> modern/to_modern/output.css +a { + b: lab(48.9487508713% 24.2085150873 -41.732226413); +} + +<===> +================================================================================ +<===> powerless/legacy/input.scss +@use "sass:color"; +a {b: color.scale(hsl(0deg 0% 50%), $space: lab)} + +<===> powerless/legacy/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> +================================================================================ +<===> powerless/modern/input.scss +@use "sass:color"; +a {b: color.scale(oklch(50% 0 0deg), $space: lab)} + +<===> powerless/modern/output.css +a { + b: oklch(50% 0 none); +} + +<===> +================================================================================ +<===> missing/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.scale(rgb(none none none))} + +<===> missing/legacy/same/implicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> missing/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.scale(rgb(none none none), $space: rgb)} + +<===> missing/legacy/same/explicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> missing/legacy/analogous/legacy/input.scss +@use "sass:color"; +a {b: color.scale(hsl(none 50% 50%), $space: hwb)} + +<===> missing/legacy/analogous/legacy/output.css +a { + b: hsl(0, 50%, 50%); +} + +<===> +================================================================================ +<===> missing/legacy/analogous/modern/input.scss +@use "sass:color"; +a {b: color.scale(rgb(none none none), $space: display-p3)} + +<===> missing/legacy/analogous/modern/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> missing/modern/same/implicit/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb none none none))} + +<===> missing/modern/same/implicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> missing/modern/same/explicit/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb none none none), $space: srgb)} + +<===> missing/modern/same/explicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> missing/modern/analogous/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb none none none), $space: display-p3)} + +<===> missing/modern/analogous/output.css +a { + b: color(srgb none none none); +} diff --git a/spec/core_functions/color/adjust_color/rgb.hrx b/spec/core_functions/color/scale/srgb.hrx similarity index 62% rename from spec/core_functions/color/adjust_color/rgb.hrx rename to spec/core_functions/color/scale/srgb.hrx index d004da8f98..90c044f48b 100644 --- a/spec/core_functions/color/adjust_color/rgb.hrx +++ b/spec/core_functions/color/scale/srgb.hrx @@ -1,206 +1,223 @@ <===> red/max/input.scss @use "sass:color"; -a {b: color.adjust(black, $red: 255)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: 100%)} <===> red/max/output.css a { - b: red; + b: color(srgb 1 0.5 0.7); } <===> ================================================================================ <===> red/min/input.scss @use "sass:color"; -a {b: color.adjust(red, $red: -255)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: -100%)} <===> red/min/output.css a { - b: black; + b: color(srgb 0 0.5 0.7); } <===> ================================================================================ <===> red/zero/input.scss @use "sass:color"; -a {b: color.adjust(black, $red: 0)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: 0%)} <===> red/zero/output.css a { - b: black; + b: color(srgb 0.2 0.5 0.7); } <===> ================================================================================ <===> red/low/input.scss @use "sass:color"; -a {b: color.adjust(red, $red: -100)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: -33%)} <===> red/low/output.css a { - b: #9b0000; + b: color(srgb 0.134 0.5 0.7); } <===> ================================================================================ <===> red/high/input.scss @use "sass:color"; -a {b: color.adjust(black, $red: 200)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $red: 86%)} <===> red/high/output.css a { - b: #c80000; + b: color(srgb 0.888 0.5 0.7); } <===> ================================================================================ <===> green/max/input.scss @use "sass:color"; -a {b: color.adjust(black, $green: 255)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: 100%)} <===> green/max/output.css a { - b: lime; + b: color(srgb 0.2 1 0.7); } <===> ================================================================================ <===> green/min/input.scss @use "sass:color"; -a {b: color.adjust(lime, $green: -255)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: -100%)} <===> green/min/output.css a { - b: black; + b: color(srgb 0.2 0 0.7); } <===> ================================================================================ <===> green/zero/input.scss @use "sass:color"; -a {b: color.adjust(black, $green: 0)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: 0%)} <===> green/zero/output.css a { - b: black; + b: color(srgb 0.2 0.5 0.7); } <===> ================================================================================ <===> green/low/input.scss @use "sass:color"; -a {b: color.adjust(lime, $green: -100)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: -86%)} <===> green/low/output.css a { - b: #009b00; + b: color(srgb 0.2 0.07 0.7); } <===> ================================================================================ <===> green/high/input.scss @use "sass:color"; -a {b: color.adjust(black, $green: 200)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $green: 12%)} <===> green/high/output.css a { - b: #00c800; + b: color(srgb 0.2 0.56 0.7); } <===> ================================================================================ <===> blue/max/input.scss @use "sass:color"; -a {b: color.adjust(black, $blue: 255)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: 100%)} <===> blue/max/output.css a { - b: blue; + b: color(srgb 0.2 0.5 1); } <===> ================================================================================ <===> blue/min/input.scss @use "sass:color"; -a {b: color.adjust(blue, $blue: -255)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: -100%)} <===> blue/min/output.css a { - b: black; + b: color(srgb 0.2 0.5 0); } <===> ================================================================================ <===> blue/zero/input.scss @use "sass:color"; -a {b: color.adjust(black, $blue: 0)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: 0%)} <===> blue/zero/output.css a { - b: black; + b: color(srgb 0.2 0.5 0.7); } <===> ================================================================================ <===> blue/low/input.scss @use "sass:color"; -a {b: color.adjust(blue, $blue: -100)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: -16%)} <===> blue/low/output.css a { - b: #00009b; + b: color(srgb 0.2 0.5 0.588); } <===> ================================================================================ <===> blue/high/input.scss @use "sass:color"; -a {b: color.adjust(black, $blue: 200)} +a {b: color.scale(color(srgb 0.2 0.5 0.7), $blue: 42%)} <===> blue/high/output.css a { - b: #0000c8; + b: color(srgb 0.2 0.5 0.826); } <===> ================================================================================ <===> all/input.scss @use "sass:color"; -a {b: color.adjust(black, $red: 12, $green: 24, $blue: 48)} +a { + b: color.scale(color(srgb 0.2 0.5 0.7), $red: 12%, $green: 24%, $blue: 48%); +} <===> all/output.css a { - b: #0c1830; + b: color(srgb 0.296 0.62 0.844); } <===> ================================================================================ <===> alpha_input/input.scss @use "sass:color"; -a {b: color.adjust(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} +a { + b: color.scale( + color(srgb 0.2 0.5 0.7 / 0.3), + $red: 12%, $green: 24%, $blue: 48% + ); +} <===> alpha_input/output.css a { - b: rgba(12, 24, 48, 0.3); + b: color(srgb 0.296 0.62 0.844 / 0.3); } <===> ================================================================================ <===> alpha_arg/input.scss @use "sass:color"; -a {b: color.adjust(black, $red: 12, $green: 24, $blue: 48, $alpha: -0.3)} +a { + b: color.scale( + color(srgb 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48%, $alpha: -70% + ); +} <===> alpha_arg/output.css a { - b: rgba(12, 24, 48, 0.7); + b: color(srgb 0.296 0.62 0.844 / 0.3); } <===> ================================================================================ <===> named/input.scss @use "sass:color"; -a {b: color.adjust($color: black, $red: 12, $green: 24, $blue: 48)} +a { + b: color.scale( + $color: color(srgb 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48% + ); +} <===> named/output.css a { - b: #0c1830; + b: color(srgb 0.296 0.62 0.844); } diff --git a/spec/core_functions/color/scale/srgb_linear.hrx b/spec/core_functions/color/scale/srgb_linear.hrx new file mode 100644 index 0000000000..ec5c7ab514 --- /dev/null +++ b/spec/core_functions/color/scale/srgb_linear.hrx @@ -0,0 +1,225 @@ +<===> red/max/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: 100%)} + +<===> red/max/output.css +a { + b: color(srgb-linear 1 0.5 0.7); +} + +<===> +================================================================================ +<===> red/min/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: -100%)} + +<===> red/min/output.css +a { + b: color(srgb-linear 0 0.5 0.7); +} + +<===> +================================================================================ +<===> red/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: 0%)} + +<===> red/zero/output.css +a { + b: color(srgb-linear 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> red/low/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: -33%)} + +<===> red/low/output.css +a { + b: color(srgb-linear 0.134 0.5 0.7); +} + +<===> +================================================================================ +<===> red/high/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $red: 86%)} + +<===> red/high/output.css +a { + b: color(srgb-linear 0.888 0.5 0.7); +} + +<===> +================================================================================ +<===> green/max/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: 100%)} + +<===> green/max/output.css +a { + b: color(srgb-linear 0.2 1 0.7); +} + +<===> +================================================================================ +<===> green/min/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: -100%)} + +<===> green/min/output.css +a { + b: color(srgb-linear 0.2 0 0.7); +} + +<===> +================================================================================ +<===> green/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: 0%)} + +<===> green/zero/output.css +a { + b: color(srgb-linear 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/low/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: -86%)} + +<===> green/low/output.css +a { + b: color(srgb-linear 0.2 0.07 0.7); +} + +<===> +================================================================================ +<===> green/high/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $green: 12%)} + +<===> green/high/output.css +a { + b: color(srgb-linear 0.2 0.56 0.7); +} + +<===> +================================================================================ +<===> blue/max/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: 100%)} + +<===> blue/max/output.css +a { + b: color(srgb-linear 0.2 0.5 1); +} + +<===> +================================================================================ +<===> blue/min/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: -100%)} + +<===> blue/min/output.css +a { + b: color(srgb-linear 0.2 0.5 0); +} + +<===> +================================================================================ +<===> blue/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: 0%)} + +<===> blue/zero/output.css +a { + b: color(srgb-linear 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> blue/low/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: -16%)} + +<===> blue/low/output.css +a { + b: color(srgb-linear 0.2 0.5 0.588); +} + +<===> +================================================================================ +<===> blue/high/input.scss +@use "sass:color"; +a {b: color.scale(color(srgb-linear 0.2 0.5 0.7), $blue: 42%)} + +<===> blue/high/output.css +a { + b: color(srgb-linear 0.2 0.5 0.826); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale( + color(srgb-linear 0.2 0.5 0.7), $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> all/output.css +a { + b: color(srgb-linear 0.296 0.62 0.844); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale( + color(srgb-linear 0.2 0.5 0.7 / 0.3), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> alpha_input/output.css +a { + b: color(srgb-linear 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + color(srgb-linear 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: color(srgb-linear 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale( + $color: color(srgb-linear 0.2 0.5 0.7), + $red: 12%, $green: 24%, $blue: 48% + ); +} + +<===> named/output.css +a { + b: color(srgb-linear 0.296 0.62 0.844); +} diff --git a/spec/core_functions/color/scale/xyz_d50.hrx b/spec/core_functions/color/scale/xyz_d50.hrx new file mode 100644 index 0000000000..99be36e19a --- /dev/null +++ b/spec/core_functions/color/scale/xyz_d50.hrx @@ -0,0 +1,217 @@ +<===> x/max/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 100%)} + +<===> x/max/output.css +a { + b: color(xyz-d50 1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/min/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: -100%)} + +<===> x/min/output.css +a { + b: color(xyz-d50 0 0.5 0.7); +} + +<===> +================================================================================ +<===> x/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 0%)} + +<===> x/zero/output.css +a { + b: color(xyz-d50 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> x/low/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: -33%)} + +<===> x/low/output.css +a { + b: color(xyz-d50 0.134 0.5 0.7); +} + +<===> +================================================================================ +<===> x/high/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 86%)} + +<===> x/high/output.css +a { + b: color(xyz-d50 0.888 0.5 0.7); +} + +<===> +================================================================================ +<===> y/max/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: 100%)} + +<===> y/max/output.css +a { + b: color(xyz-d50 0.2 1 0.7); +} + +<===> +================================================================================ +<===> y/min/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: -100%)} + +<===> y/min/output.css +a { + b: color(xyz-d50 0.2 0 0.7); +} + +<===> +================================================================================ +<===> y/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: 0%)} + +<===> y/zero/output.css +a { + b: color(xyz-d50 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> y/low/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: -86%)} + +<===> y/low/output.css +a { + b: color(xyz-d50 0.2 0.07 0.7); +} + +<===> +================================================================================ +<===> y/high/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $y: 12%)} + +<===> y/high/output.css +a { + b: color(xyz-d50 0.2 0.56 0.7); +} + +<===> +================================================================================ +<===> z/max/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: 100%)} + +<===> z/max/output.css +a { + b: color(xyz-d50 0.2 0.5 1); +} + +<===> +================================================================================ +<===> z/min/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: -100%)} + +<===> z/min/output.css +a { + b: color(xyz-d50 0.2 0.5 0); +} + +<===> +================================================================================ +<===> z/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: 0%)} + +<===> z/zero/output.css +a { + b: color(xyz-d50 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> z/low/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: -16%)} + +<===> z/low/output.css +a { + b: color(xyz-d50 0.2 0.5 0.588); +} + +<===> +================================================================================ +<===> z/high/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d50 0.2 0.5 0.7), $z: 42%)} + +<===> z/high/output.css +a { + b: color(xyz-d50 0.2 0.5 0.826); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale(color(xyz-d50 0.2 0.5 0.7), $x: 12%, $y: 24%, $z: 48%); +} + +<===> all/output.css +a { + b: color(xyz-d50 0.296 0.62 0.844); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale(color(xyz-d50 0.2 0.5 0.7 / 0.3), $x: 12%, $y: 24%, $z: 48%); +} + +<===> alpha_input/output.css +a { + b: color(xyz-d50 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + color(xyz-d50 0.2 0.5 0.7), + $x: 12%, $y: 24%, $z: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: color(xyz-d50 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale($color: color(xyz-d50 0.2 0.5 0.7), $x: 12%, $y: 24%, $z: 48%); +} + +<===> named/output.css +a { + b: color(xyz-d50 0.296 0.62 0.844); +} diff --git a/spec/core_functions/color/scale/xyz_d65.hrx b/spec/core_functions/color/scale/xyz_d65.hrx new file mode 100644 index 0000000000..96488172da --- /dev/null +++ b/spec/core_functions/color/scale/xyz_d65.hrx @@ -0,0 +1,217 @@ +<===> x/max/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 100%)} + +<===> x/max/output.css +a { + b: color(xyz 1 0.5 0.7); +} + +<===> +================================================================================ +<===> x/min/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: -100%)} + +<===> x/min/output.css +a { + b: color(xyz 0 0.5 0.7); +} + +<===> +================================================================================ +<===> x/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 0%)} + +<===> x/zero/output.css +a { + b: color(xyz 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> x/low/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: -33%)} + +<===> x/low/output.css +a { + b: color(xyz 0.134 0.5 0.7); +} + +<===> +================================================================================ +<===> x/high/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 86%)} + +<===> x/high/output.css +a { + b: color(xyz 0.888 0.5 0.7); +} + +<===> +================================================================================ +<===> y/max/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: 100%)} + +<===> y/max/output.css +a { + b: color(xyz 0.2 1 0.7); +} + +<===> +================================================================================ +<===> y/min/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: -100%)} + +<===> y/min/output.css +a { + b: color(xyz 0.2 0 0.7); +} + +<===> +================================================================================ +<===> y/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: 0%)} + +<===> y/zero/output.css +a { + b: color(xyz 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> y/low/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: -86%)} + +<===> y/low/output.css +a { + b: color(xyz 0.2 0.07 0.7); +} + +<===> +================================================================================ +<===> y/high/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $y: 12%)} + +<===> y/high/output.css +a { + b: color(xyz 0.2 0.56 0.7); +} + +<===> +================================================================================ +<===> z/max/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: 100%)} + +<===> z/max/output.css +a { + b: color(xyz 0.2 0.5 1); +} + +<===> +================================================================================ +<===> z/min/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: -100%)} + +<===> z/min/output.css +a { + b: color(xyz 0.2 0.5 0); +} + +<===> +================================================================================ +<===> z/zero/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: 0%)} + +<===> z/zero/output.css +a { + b: color(xyz 0.2 0.5 0.7); +} + +<===> +================================================================================ +<===> z/low/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: -16%)} + +<===> z/low/output.css +a { + b: color(xyz 0.2 0.5 0.588); +} + +<===> +================================================================================ +<===> z/high/input.scss +@use "sass:color"; +a {b: color.scale(color(xyz-d65 0.2 0.5 0.7), $z: 42%)} + +<===> z/high/output.css +a { + b: color(xyz 0.2 0.5 0.826); +} + +<===> +================================================================================ +<===> all/input.scss +@use "sass:color"; +a { + b: color.scale(color(xyz-d65 0.2 0.5 0.7), $x: 12%, $y: 24%, $z: 48%); +} + +<===> all/output.css +a { + b: color(xyz 0.296 0.62 0.844); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use "sass:color"; +a { + b: color.scale(color(xyz-d65 0.2 0.5 0.7 / 0.3), $x: 12%, $y: 24%, $z: 48%); +} + +<===> alpha_input/output.css +a { + b: color(xyz 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use "sass:color"; +a { + b: color.scale( + color(xyz-d65 0.2 0.5 0.7), + $x: 12%, $y: 24%, $z: 48%, $alpha: -70% + ); +} + +<===> alpha_arg/output.css +a { + b: color(xyz 0.296 0.62 0.844 / 0.3); +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a { + b: color.scale($color: color(xyz-d65 0.2 0.5 0.7), $x: 12%, $y: 24%, $z: 48%); +} + +<===> named/output.css +a { + b: color(xyz 0.296 0.62 0.844); +} diff --git a/spec/core_functions/color/scale_color/error/bounds.hrx b/spec/core_functions/color/scale_color/error/bounds.hrx deleted file mode 100644 index a4b001d642..0000000000 --- a/spec/core_functions/color/scale_color/error/bounds.hrx +++ /dev/null @@ -1,221 +0,0 @@ -<===> red/too_low/input.scss -@use "sass:color"; -a {b: color.scale(red, $red: -100.001%)} - -<===> red/too_low/error -Error: $red: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $red: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> red/too_high/input.scss -@use "sass:color"; -a {b: color.scale(red, $red: 100.001%)} - -<===> red/too_high/error -Error: $red: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $red: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> green/too_low/input.scss -@use "sass:color"; -a {b: color.scale(green, $green: -100.001%)} - -<===> green/too_low/error -Error: $green: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(green, $green: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> green/too_high/input.scss -@use "sass:color"; -a {b: color.scale(green, $green: 100.001%)} - -<===> green/too_high/error -Error: $green: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(green, $green: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_low/input.scss -@use "sass:color"; -a {b: color.scale(blue, $blue: -100.001%)} - -<===> blue/too_low/error -Error: $blue: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(blue, $blue: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_high/input.scss -@use "sass:color"; -a {b: color.scale(blue, $blue: 100.001%)} - -<===> blue/too_high/error -Error: $blue: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(blue, $blue: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_low/input.scss -@use "sass:color"; -a {b: color.scale(red, $saturation: -100.001%)} - -<===> saturation/too_low/error -Error: $saturation: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $saturation: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_high/input.scss -@use "sass:color"; -a {b: color.scale(red, $saturation: 100.001%)} - -<===> saturation/too_high/error -Error: $saturation: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $saturation: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_low/input.scss -@use "sass:color"; -a {b: color.scale(red, $lightness: -100.001%)} - -<===> lightness/too_low/error -Error: $lightness: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $lightness: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_high/input.scss -@use "sass:color"; -a {b: color.scale(red, $lightness: 100.001%)} - -<===> lightness/too_high/error -Error: $lightness: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $lightness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_low/input.scss -@use "sass:color"; -a {b: color.scale(red, $alpha: -100.001%)} - -<===> alpha/too_low/error -Error: $alpha: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $alpha: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_high/input.scss -@use "sass:color"; -a {b: color.scale(red, $alpha: 100.001%)} - -<===> alpha/too_high/error -Error: $alpha: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $alpha: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_low/input.scss -@use "sass:color"; -a {b: color.scale(red, $blackness: -100.001%)} - -<===> blackness/too_low/error -Error: $blackness: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $blackness: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_high/input.scss -@use "sass:color"; -a {b: color.scale(red, $blackness: 100.001%)} - -<===> blackness/too_high/error -Error: $blackness: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $blackness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_low/input.scss -@use "sass:color"; -a {b: color.scale(red, $whiteness: -100.001%)} - -<===> whiteness/too_low/error -Error: $whiteness: Expected -100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $whiteness: -100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_high/input.scss -@use "sass:color"; -a {b: color.scale(red, $whiteness: 100.001%)} - -<===> whiteness/too_high/error -Error: $whiteness: Expected 100.001% to be within -100% and 100%. - , -2 | a {b: color.scale(red, $whiteness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/error/units.hrx b/spec/core_functions/color/scale_color/error/units.hrx deleted file mode 100644 index 35669fadba..0000000000 --- a/spec/core_functions/color/scale_color/error/units.hrx +++ /dev/null @@ -1,221 +0,0 @@ -<===> none/red/input.scss -@use "sass:color"; -a {b: color.scale(red, $red: 1px)} - -<===> none/red/error -Error: $red: Expected 1px to have unit "%". - , -2 | a {b: color.scale(red, $red: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> none/green/input.scss -@use "sass:color"; -a {b: color.scale(green, $green: 1)} - -<===> none/green/error -Error: $green: Expected 1 to have unit "%". - , -2 | a {b: color.scale(green, $green: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> none/blue/input.scss -@use "sass:color"; -a {b: color.scale(blue, $blue: 1)} - -<===> none/blue/error -Error: $blue: Expected 1 to have unit "%". - , -2 | a {b: color.scale(blue, $blue: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> none/saturation/input.scss -@use "sass:color"; -a {b: color.scale(red, $saturation: 1)} - -<===> none/saturation/error -Error: $saturation: Expected 1 to have unit "%". - , -2 | a {b: color.scale(red, $saturation: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> none/lightness/input.scss -@use "sass:color"; -a {b: color.scale(red, $lightness: 1)} - -<===> none/lightness/error -Error: $lightness: Expected 1 to have unit "%". - , -2 | a {b: color.scale(red, $lightness: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> none/whiteness/input.scss -@use "sass:color"; -a {b: color.scale(white, $whiteness: 1)} - -<===> none/whiteness/error -Error: $whiteness: Expected 1 to have unit "%". - , -2 | a {b: color.scale(white, $whiteness: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> none/blackness/input.scss -@use "sass:color"; -a {b: color.scale(black, $blackness: 1)} - -<===> none/blackness/error -Error: $blackness: Expected 1 to have unit "%". - , -2 | a {b: color.scale(black, $blackness: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> none/alpha/input.scss -@use "sass:color"; -a {b: color.scale(red, $alpha: 1)} - -<===> none/alpha/error -Error: $alpha: Expected 1 to have unit "%". - , -2 | a {b: color.scale(red, $alpha: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/red/input.scss -@use "sass:color"; -a {b: color.scale(red, $red: 1px)} - -<===> wrong/red/error -Error: $red: Expected 1px to have unit "%". - , -2 | a {b: color.scale(red, $red: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/green/input.scss -@use "sass:color"; -a {b: color.scale(green, $green: 1px)} - -<===> wrong/green/error -Error: $green: Expected 1px to have unit "%". - , -2 | a {b: color.scale(green, $green: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/blue/input.scss -@use "sass:color"; -a {b: color.scale(blue, $blue: 1px)} - -<===> wrong/blue/error -Error: $blue: Expected 1px to have unit "%". - , -2 | a {b: color.scale(blue, $blue: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/saturation/input.scss -@use "sass:color"; -a {b: color.scale(red, $saturation: 1px)} - -<===> wrong/saturation/error -Error: $saturation: Expected 1px to have unit "%". - , -2 | a {b: color.scale(red, $saturation: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/lightness/input.scss -@use "sass:color"; -a {b: color.scale(red, $lightness: 1px)} - -<===> wrong/lightness/error -Error: $lightness: Expected 1px to have unit "%". - , -2 | a {b: color.scale(red, $lightness: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/whiteness/input.scss -@use "sass:color"; -a {b: color.scale(white, $whiteness: 1px)} - -<===> wrong/whiteness/error -Error: $whiteness: Expected 1px to have unit "%". - , -2 | a {b: color.scale(white, $whiteness: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/blackness/input.scss -@use "sass:color"; -a {b: color.scale(black, $blackness: 1px)} - -<===> wrong/blackness/error -Error: $blackness: Expected 1px to have unit "%". - , -2 | a {b: color.scale(black, $blackness: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> wrong/alpha/input.scss -@use "sass:color"; -a {b: color.scale(red, $alpha: 1px)} - -<===> wrong/alpha/error -Error: $alpha: Expected 1px to have unit "%". - , -2 | a {b: color.scale(red, $alpha: 1px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/space.hrx b/spec/core_functions/color/space.hrx new file mode 100644 index 0000000000..d8ee18ad72 --- /dev/null +++ b/spec/core_functions/color/space.hrx @@ -0,0 +1,258 @@ +<===> rgb/input.scss +@use "sass:color"; +a {b: color.space(rgb(0 255 0))} + +<===> rgb/output.css +a { + b: rgb; +} + +<===> +================================================================================ +<===> rgba/input.scss +@use "sass:color"; +a {b: color.space(rgba(72 122 180 / .2))} + +<===> rgba/output.css +a { + b: rgb; +} + +<===> +================================================================================ +<===> hwb/input.scss +@use "sass:color"; +a {b: color.space(hwb(0 50% 0%))} + +<===> hwb/output.css +a { + b: hwb; +} + +<===> +================================================================================ +<===> hsl/input.scss +@use "sass:color"; +a {b: color.space(hsl(110 31% 32%))} + +<===> hsl/output.css +a { + b: hsl; +} + +<===> +================================================================================ +<===> hex/input.scss +@use "sass:color"; +a {b: color.space(#f2ece4)} + +<===> hex/output.css +a { + b: rgb; +} + +<===> +================================================================================ +<===> named/input.scss +@use "sass:color"; +a {b: color.space($color: midnightblue)} + +<===> named/output.css +a { + b: rgb; +} + +<===> +================================================================================ +<===> srgb/input.scss +@use "sass:color"; +a {b: color.space(color(srgb 0.45098 0.07843 0.823530))} + +<===> srgb/output.css +a { + b: srgb; +} + +<===> +================================================================================ +<===> srgb-linear/input.scss +@use "sass:color"; +a {b: color.space(color(srgb-linear 0.45098 0.07843 0.823530))} + +<===> srgb-linear/output.css +a { + b: srgb-linear; +} + +<===> +================================================================================ +<===> display-p3/input.scss +@use "sass:color"; +a {b: color.space(color(display-p3 0.515 0.35 0.3 / 1))} + +<===> display-p3/output.css +a { + b: display-p3; +} + +<===> +================================================================================ +<===> a98-rgb/input.scss +@use "sass:color"; +a {b: color.space(color(a98-rgb 0 1 0))} + +<===> a98-rgb/output.css +a { + b: a98-rgb; +} + +<===> +================================================================================ +<===> prophoto-rgb/input.scss +@use "sass:color"; +a {b: color.space(color(prophoto-rgb 0.42444 0.934918 0.190922))} + +<===> prophoto-rgb/output.css +a { + b: prophoto-rgb; +} + +<===> +================================================================================ +<===> rec2020/input.scss +@use "sass:color"; +a {b: color.space(color(rec2020 0.42053 0.979780 0.00579))} + +<===> rec2020/output.css +a { + b: rec2020; +} + +<===> +================================================================================ +<===> xyz/input.scss +@use "sass:color"; +a {b: color.space(color(xyz 0.0426 0.0442 0.0364))} + +<===> xyz/output.css +a { + b: xyz; +} + +<===> +================================================================================ +<===> xyz-d50/input.scss +@use "sass:color"; +a {b: color.space(color(xyz-d50 0.2005 0.14089 0.4472))} + +<===> xyz-d50/output.css +a { + b: xyz-d50; +} + +<===> +================================================================================ +<===> xyz-d65/input.scss +@use "sass:color"; +a {b: color.space(color(xyz-d65 0.21661 0.14602 0.59452))} + +<===> xyz-d65/output.css +a { + b: xyz; +} + +<===> +================================================================================ +<===> lab/input.scss +@use "sass:color"; +a {b: color.space(lab(5 110 115))} + +<===> lab/output.css +a { + b: lab; +} + +<===> +================================================================================ +<===> lch/input.scss +@use "sass:color"; +a {b: color.space(lch(90.6 52.8 197))} + +<===> lch/output.css +a { + b: lch; +} + +<===> +================================================================================ +<===> oklab/input.scss +@use "sass:color"; +a {b: color.space(oklab(0.44027 0.08818 -0.13386))} + +<===> oklab/output.css +a { + b: oklab; +} + +<===> +================================================================================ +<===> oklch/input.scss +@use "sass:color"; +a {b: color.space(oklch(70% 0.1 200))} + +<===> oklch/output.css +a { + b: oklch; +} + +<===> +================================================================================ +<===> error/too_few_args/input.scss +@use "sass:color"; +a {b: color.space()} + +<===> error/too_few_args/error +Error: Missing argument $color. + ,--> input.scss +2 | a {b: color.space()} + | ^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function space($color) { + | ============= declaration + ' + input.scss 2:7 root stylesheet + +<===> error/too_few_args/error + +<===> +================================================================================ +<===> error/too_many_args/input.scss +@use "sass:color"; +a {b: color.space(rgb(0 255 0), a)} + +<===> error/too_many_args/error +Error: Only 1 argument allowed, but 2 were passed. + ,--> input.scss +2 | a {b: color.space(rgb(0 255 0), a)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function space($color) { + | ============= declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/type/input.scss +@use "sass:color"; +a {b: color.space(1)} + +<===> error/type/error +Error: $color: 1 is not a color. + , +2 | a {b: color.space(1)} + | ^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/to_gamut/a98_rgb.hrx b/spec/core_functions/color/to_gamut/a98_rgb.hrx new file mode 100644 index 0000000000..5fbe456a74 --- /dev/null +++ b/spec/core_functions/color/to_gamut/a98_rgb.hrx @@ -0,0 +1,63 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(a98-rgb 0.2 0.5 0.8), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: color(a98-rgb 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(a98-rgb 1.5 0.5 0.8), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: color(a98-rgb 1 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(a98-rgb 0.2 0.5 0.8), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: color(a98-rgb 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(a98-rgb 1.1 0.5 0.8), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: color(a98-rgb 1 0.5850609654 0.8001989835); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(a98-rgb 0.8 1.1 1.4), $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(a98-rgb 0 -0.05 -0.05), $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: color(a98-rgb 0 0 0); +} diff --git a/spec/core_functions/color/to_gamut/display_p3.hrx b/spec/core_functions/color/to_gamut/display_p3.hrx new file mode 100644 index 0000000000..a4d8f4e7de --- /dev/null +++ b/spec/core_functions/color/to_gamut/display_p3.hrx @@ -0,0 +1,63 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(display-p3 0.2 0.5 0.8), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: color(display-p3 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(display-p3 1.5 0.5 0.8), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: color(display-p3 1 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(display-p3 0.2 0.5 0.8), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: color(display-p3 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(display-p3 1.5 0.5 0.8), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: color(display-p3 1 0.9080382844 0.9302909848); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(display-p3 0.8 1.1 1.4), $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(display-p3 0 -0.05 -0.05), $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: color(display-p3 0 0 0); +} diff --git a/spec/core_functions/color/to_gamut/error.hrx b/spec/core_functions/color/to_gamut/error.hrx new file mode 100644 index 0000000000..87bb177c5b --- /dev/null +++ b/spec/core_functions/color/to_gamut/error.hrx @@ -0,0 +1,163 @@ +<===> color/type/input.scss +@use "sass:color"; +a {b: color.to-gamut(c, $method: local-minde)} + +<===> color/type/error +Error: $color: c is not a color. + , +2 | a {b: color.to-gamut(c, $method: local-minde)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/type/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, $space: red, $method: local-minde)} + +<===> space/type/error +Error: $space: red is not a string. + , +2 | a {b: color.to-gamut(pink, $space: red, $method: local-minde)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/unknown/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, $space: c, $method: local-minde)} + +<===> space/unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.to-gamut(pink, $space: c, $method: local-minde)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/quoted/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, $space: "rgb", $method: local-minde)} + +<===> space/quoted/error +Error: $space: Expected "rgb" to be an unquoted string. + , +2 | a {b: color.to-gamut(pink, $space: "rgb", $method: local-minde)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> method/type/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, $method: 1)} + +<===> method/type/error +Error: $method: 1 is not a string. + , +2 | a {b: color.to-gamut(pink, $method: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> method/unknown/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, $method: c)} + +<===> method/unknown/error +Error: Unknown gamut map method "c". + , +2 | a {b: color.to-gamut(pink, $method: c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> method/quoted/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, $method: "clip")} + +<===> method/quoted/error +Error: $method: Expected "clip" to be an unquoted string. + , +2 | a {b: color.to-gamut(pink, $method: "clip")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> method/absent/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink)} + +<===> method/absent/error +Error: $method: color.to-gamut() requires a $method argument for forwards-compatibility with changes in the CSS spec. Suggestion: + +$method: local-minde + , +2 | a {b: color.to-gamut(pink)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> method/null/input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, $method: null)} + +<===> method/null/error +Error: $method: color.to-gamut() requires a $method argument for forwards-compatibility with changes in the CSS spec. Suggestion: + +$method: local-minde + , +2 | a {b: color.to-gamut(pink, $method: null)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/input.scss +@use "sass:color"; +a {b: color.to-gamut()} + +<===> too_few_args/error +Error: Missing argument $color. + ,--> input.scss +2 | a {b: color.to-gamut()} + | ^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function to-gamut($color, $space: null, $method: null) { + | ============================================= declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +@use "sass:color"; +a {b: color.to-gamut(red, rgb, clip, c)} + +<===> too_many_args/error +Error: Only 3 arguments allowed, but 4 were passed. + ,--> input.scss +2 | a {b: color.to-gamut(red, rgb, clip, c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function to-gamut($color, $space: null, $method: null) { + | ============================================= declaration + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/to_gamut/hsl.hrx b/spec/core_functions/color/to_gamut/hsl.hrx new file mode 100644 index 0000000000..83e74bb291 --- /dev/null +++ b/spec/core_functions/color/to_gamut/hsl.hrx @@ -0,0 +1,83 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(70deg 50% 50%), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: hsl(70, 50%, 50%); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(hsl(70deg 50% 50%), $saturation: 200%), + $method: clip + ); +} + +<===> clip/out_of_gamut/output.css +a { + b: hsl(70, 100%, 50%); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(70deg 50% 50%), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: hsl(70, 50%, 50%); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(hsl(70deg 50% 50%), $saturation: 107%), + $method: local-minde + ); +} + +<===> local_minde/out_of_gamut/output.css +a { + b: hsl(73.5850781672, 100%, 67.4750294398%); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(hsl(70deg 50% 50%), $saturation: 120%), + $method: local-minde + ); +} + +<===> local_minde/to_white/output.css +a { + b: hsl(none 0% 100%); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(hsl(70deg 100% 50%), $lightness: -1%), + $method: local-minde + ); +} + +<===> local_minde/to_black/output.css +a { + b: hsl(none 0% 0%); +} diff --git a/spec/core_functions/color/to_gamut/hwb.hrx b/spec/core_functions/color/to_gamut/hwb.hrx new file mode 100644 index 0000000000..38fd408772 --- /dev/null +++ b/spec/core_functions/color/to_gamut/hwb.hrx @@ -0,0 +1,63 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(hwb(70deg 30% 30%), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: hsl(70, 40%, 50%); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(hwb(70deg 200% -50%), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(hwb(70deg 30% 30%), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: hsl(70, 40%, 50%); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(hwb(70deg -5% -5%), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: hsl(75.7157487534, 100%, 75.8982992248%); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(hwb(70deg -10% -10%), $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: hwb(none 100% 0%); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(hwb(70deg -2% 100%), $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: hwb(none 0% 100%); +} diff --git a/spec/core_functions/color/to_gamut/lab.hrx b/spec/core_functions/color/to_gamut/lab.hrx new file mode 100644 index 0000000000..60d1897deb --- /dev/null +++ b/spec/core_functions/color/to_gamut/lab.hrx @@ -0,0 +1,29 @@ +<===> clip/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(lab(50% 500 -999999), $lightness: 150%), + $method: clip + ); +} + +<===> clip/output.css +a { + b: color-mix(in lab, color(xyz 6530020637.921538 2172031124.122868 137328815479.04425) 100%, black); +} + +<===> +================================================================================ +<===> local_minde/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(lab(50% 500 -999999), $lightness: 150%), + $method: local-minde + ); +} + +<===> local_minde/output.css +a { + b: color-mix(in lab, color(xyz 6530020637.921538 2172031124.122868 137328815479.04425) 100%, black); +} diff --git a/spec/core_functions/color/to_gamut/lch.hrx b/spec/core_functions/color/to_gamut/lch.hrx new file mode 100644 index 0000000000..4c0fd721b7 --- /dev/null +++ b/spec/core_functions/color/to_gamut/lch.hrx @@ -0,0 +1,29 @@ +<===> clip/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(lch(50% 200% 70deg), $lightness: 150%), + $method: clip + ); +} + +<===> clip/output.css +a { + b: color-mix(in lch, color(xyz 3.9677504831 2.839747694 -0.024493753) 100%, black); +} + +<===> +================================================================================ +<===> local_minde/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(lch(50% 200% 70deg), $lightness: 150%), + $method: local-minde + ); +} + +<===> local_minde/output.css +a { + b: color-mix(in lch, color(xyz 3.9677504831 2.839747694 -0.024493753) 100%, black); +} diff --git a/spec/core_functions/color/to_gamut/named.hrx b/spec/core_functions/color/to_gamut/named.hrx new file mode 100644 index 0000000000..ece135cde1 --- /dev/null +++ b/spec/core_functions/color/to_gamut/named.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.to-gamut($color: pink, $space: rgb, $method: local-minde)} + +<===> output.css +a { + b: pink; +} diff --git a/spec/core_functions/color/to_gamut/oklab.hrx b/spec/core_functions/color/to_gamut/oklab.hrx new file mode 100644 index 0000000000..c6e6780dbf --- /dev/null +++ b/spec/core_functions/color/to_gamut/oklab.hrx @@ -0,0 +1,29 @@ +<===> clip/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(oklab(50% 500 -999999), $lightness: 150%), + $method: clip + ); +} + +<===> clip/output.css +a { + b: color-mix(in oklab, color(xyz 593644537356868864 -153762261215017152 3418717280664545280) 100%, black); +} + +<===> +================================================================================ +<===> local_minde/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(oklab(50% 500 -999999), $lightness: 150%), + $method: local-minde + ); +} + +<===> local_minde/output.css +a { + b: color-mix(in oklab, color(xyz 593644537356868864 -153762261215017152 3418717280664545280) 100%, black); +} diff --git a/spec/core_functions/color/to_gamut/oklch.hrx b/spec/core_functions/color/to_gamut/oklch.hrx new file mode 100644 index 0000000000..8394a7c7c5 --- /dev/null +++ b/spec/core_functions/color/to_gamut/oklch.hrx @@ -0,0 +1,29 @@ +<===> clip/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(oklch(50% 200% 70deg), $lightness: 150%), + $method: clip + ); +} + +<===> clip/output.css +a { + b: color-mix(in oklch, color(xyz 5.2395754107 2.9713210909 -1.434870419) 100%, black); +} + +<===> +================================================================================ +<===> local_minde/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(oklch(50% 200% 70deg), $lightness: 150%), + $method: local-minde + ); +} + +<===> local_minde/output.css +a { + b: color-mix(in oklch, color(xyz 5.2395754107 2.9713210909 -1.434870419) 100%, black); +} diff --git a/spec/core_functions/color/to_gamut/positional.hrx b/spec/core_functions/color/to_gamut/positional.hrx new file mode 100644 index 0000000000..c4bf4f302c --- /dev/null +++ b/spec/core_functions/color/to_gamut/positional.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.to-gamut(pink, rgb, local-minde)} + +<===> output.css +a { + b: pink; +} diff --git a/spec/core_functions/color/to_gamut/prophoto_rgb.hrx b/spec/core_functions/color/to_gamut/prophoto_rgb.hrx new file mode 100644 index 0000000000..f78d0b034f --- /dev/null +++ b/spec/core_functions/color/to_gamut/prophoto_rgb.hrx @@ -0,0 +1,63 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(prophoto-rgb 0.2 0.5 0.8), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(prophoto-rgb 1.5 0.5 0.8), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: color(prophoto-rgb 1 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(prophoto-rgb 0.2 0.5 0.8), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(prophoto-rgb 1.1 0.5 0.8), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: color(prophoto-rgb 1 0.5625312196 0.7939519528); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(prophoto-rgb 0.8 1.1 1.4), $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(prophoto-rgb 0 -0.05 -0.05), $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} diff --git a/spec/core_functions/color/to_gamut/rec2020.hrx b/spec/core_functions/color/to_gamut/rec2020.hrx new file mode 100644 index 0000000000..ba8c3aee64 --- /dev/null +++ b/spec/core_functions/color/to_gamut/rec2020.hrx @@ -0,0 +1,63 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(rec2020 0.2 0.5 0.8), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: color(rec2020 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(rec2020 1.5 0.5 0.8), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: color(rec2020 1 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(rec2020 0.2 0.5 0.8), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: color(rec2020 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(rec2020 1.1 0.5 0.8), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: color(rec2020 1 0.5720949845 0.7959438083); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(rec2020 0.8 1.1 1.4), $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(rec2020 0 -0.05 -0.05), $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: color(rec2020 0 0 0); +} diff --git a/spec/core_functions/color/to_gamut/rgb.hrx b/spec/core_functions/color/to_gamut/rgb.hrx new file mode 100644 index 0000000000..ef5d5b3f9b --- /dev/null +++ b/spec/core_functions/color/to_gamut/rgb.hrx @@ -0,0 +1,73 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(#abcdef, $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: #abcdef; +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color.change(#abcdef, $red: 300), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: #ffcdef; +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(#abcdef, $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: #abcdef; +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color.change(#abcdef, $red: 300), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: rgb(255, 222.6637652053, 237.9231180222); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(#e6ff00, $green: 280, $blue: -25), + $method: local-minde + ); +} + +<===> local_minde/to_white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(black, $red: -5, $green: -5), + $method: local-minde + ); +} + +<===> local_minde/to_black/output.css +a { + b: black; +} diff --git a/spec/core_functions/color/to_gamut/space.hrx b/spec/core_functions/color/to_gamut/space.hrx new file mode 100644 index 0000000000..99f46fe997 --- /dev/null +++ b/spec/core_functions/color/to_gamut/space.hrx @@ -0,0 +1,383 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(60% 0.13 240deg), $space: rgb, $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: oklch(60% 0.13 240deg); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(60% 0.15 240deg), $space: rgb, $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: oklch(60.4068473688% 0.1443906201 242.3895382399deg); +} + +<===> +================================================================================ +<===> clip/missing/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.to-gamut(rgb(none none none), $method: clip)} + +<===> clip/missing/legacy/same/implicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> clip/missing/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.to-gamut(rgb(none none none), $space: rgb, $method: clip)} + +<===> clip/missing/legacy/same/explicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> clip/missing/legacy/same/with_mapping/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(rgb(none 0 none), $green: 300), + $method: clip + ); +} + +<===> clip/missing/legacy/same/with_mapping/output.css +a { + b: rgb(none 255 none); +} + +<===> +================================================================================ +<===> clip/missing/legacy/analogous/legacy/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(none 50% 50%), $space: hwb, $method: clip)} + +<===> clip/missing/legacy/analogous/legacy/output.css +a { + b: hsl(0, 50%, 50%); +} + +<===> +================================================================================ +<===> clip/missing/legacy/analogous/modern/input.scss +@use "sass:color"; +a {b: color.to-gamut(rgb(none none none), $space: display-p3, $method: clip)} + +<===> clip/missing/legacy/analogous/modern/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> clip/missing/modern/same/implicit/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb none none none), $method: clip)} + +<===> clip/missing/modern/same/implicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> clip/missing/modern/same/explicit/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb none none none), $space: srgb, $method: clip)} + +<===> clip/missing/modern/same/explicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> clip/missing/modern/same/with_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb none 1.2 none), $method: clip)} + +<===> clip/missing/modern/same/with_mapping/output.css +a { + b: color(srgb none 1 none); +} + +<===> +================================================================================ +<===> clip/missing/modern/analogous/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color(srgb none none none), + $space: display-p3, + $method: clip + ); +} + +<===> clip/missing/modern/analogous/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> clip/powerless/legacy/no_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(0deg 0% 20%), $space: srgb, $method: clip)} + +<===> clip/powerless/legacy/no_mapping/output.css +a { + b: hsl(0, 0%, 20%); +} + +<===> +================================================================================ +<===> clip/powerless/legacy/with_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(0deg 10% 1000%), $space: srgb, $method: clip)} + +<===> clip/powerless/legacy/with_mapping/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> clip/powerless/modern/no_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(10% 0% 0deg), $space: srgb, $method: clip)} + +<===> clip/powerless/modern/no_mapping/output.css +a { + b: oklch(10% 0 none); +} + +<===> +================================================================================ +<===> clip/powerless/modern/with_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(lch(1000% 10% 0deg), $space: hsl, $method: clip)} + +<===> clip/powerless/modern/with_mapping/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(60% 0.13 240deg), $space: rgb, $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: oklch(60% 0.13 240deg); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(60% 0.15 240deg), $space: rgb, $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: oklch(60.4068473688% 0.1443906201 242.3895382399deg); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(100% 0.13 240deg), $space: rgb, $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(0% 0.13 240deg), $space: rgb, $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> local_minde/missing/legacy/same/implicit/input.scss +@use "sass:color"; +a {b: color.to-gamut(rgb(none none none), $method: local-minde)} + +<===> local_minde/missing/legacy/same/implicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> local_minde/missing/legacy/same/explicit/input.scss +@use "sass:color"; +a {b: color.to-gamut(rgb(none none none), $space: rgb, $method: local-minde)} + +<===> local_minde/missing/legacy/same/explicit/output.css +a { + b: rgb(none none none); +} + +<===> +================================================================================ +<===> local_minde/missing/legacy/same/with_mapping/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color.change(rgb(none 0 none), $green: 300), + $method: local-minde + ); +} + +<===> local_minde/missing/legacy/same/with_mapping/output.css +a { + b: rgb(220.0210985908, 255, 215.6454599021); +} + +<===> +================================================================================ +<===> local_minde/missing/legacy/analogous/legacy/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(none 50% 50%), $space: hwb, $method: local-minde)} + +<===> local_minde/missing/legacy/analogous/legacy/output.css +a { + b: hsl(0, 50%, 50%); +} + +<===> +================================================================================ +<===> local_minde/missing/legacy/analogous/modern/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + rgb(none none none), + $space: display-p3, + $method: local-minde + ); +} + +<===> local_minde/missing/legacy/analogous/modern/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> local_minde/missing/modern/same/implicit/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb none none none), $method: local-minde)} + +<===> local_minde/missing/modern/same/implicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> local_minde/missing/modern/same/explicit/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color(srgb none none none), + $space: srgb, + $method: local-minde + ); +} + +<===> local_minde/missing/modern/same/explicit/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> local_minde/missing/modern/same/with_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb none 1.2 none), $method: local-minde)} + +<===> local_minde/missing/modern/same/with_mapping/output.css +a { + b: color(srgb 0.9249489323 1 0.9135716721); +} + +<===> +================================================================================ +<===> local_minde/missing/modern/analogous/input.scss +@use "sass:color"; +a { + b: color.to-gamut( + color(srgb none none none), + $space: display-p3, + $method: local-minde + ); +} + +<===> local_minde/missing/modern/analogous/output.css +a { + b: color(srgb none none none); +} + +<===> +================================================================================ +<===> local_minde/powerless/legacy/no_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(0deg 0% 20%), $space: srgb, $method: local-minde)} + +<===> local_minde/powerless/legacy/no_mapping/output.css +a { + b: hsl(0, 0%, 20%); +} + +<===> +================================================================================ +<===> local_minde/powerless/legacy/with_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(hsl(0deg 10% 1000%), $space: srgb, $method: local-minde)} + +<===> local_minde/powerless/legacy/with_mapping/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> local_minde/powerless/modern/no_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(oklch(10% 0% 0deg), $space: srgb, $method: local-minde)} + +<===> local_minde/powerless/modern/no_mapping/output.css +a { + b: oklch(10% 0 none); +} + +<===> +================================================================================ +<===> local_minde/powerless/modern/with_mapping/input.scss +@use "sass:color"; +a {b: color.to-gamut(lch(1000% 10% 0deg), $space: srgb, $method: local-minde)} + +<===> local_minde/powerless/modern/with_mapping/output.css +a { + b: lch(100% 0 none); +} diff --git a/spec/core_functions/color/to_gamut/srgb.hrx b/spec/core_functions/color/to_gamut/srgb.hrx new file mode 100644 index 0000000000..34df863306 --- /dev/null +++ b/spec/core_functions/color/to_gamut/srgb.hrx @@ -0,0 +1,63 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb 0.2 0.5 0.8), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: color(srgb 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb 1.5 0.5 0.8), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: color(srgb 1 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb 0.2 0.5 0.8), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: color(srgb 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb 1.5 0.5 0.8), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: color(srgb 1 0.8660162103 0.8987034234); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb 0.9 1.1 -0.1), $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb 0 -0.05 -0.05), $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: color(srgb 0 0 0); +} diff --git a/spec/core_functions/color/to_gamut/srgb_linear.hrx b/spec/core_functions/color/to_gamut/srgb_linear.hrx new file mode 100644 index 0000000000..5daf813118 --- /dev/null +++ b/spec/core_functions/color/to_gamut/srgb_linear.hrx @@ -0,0 +1,63 @@ +<===> clip/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb-linear 0.2 0.5 0.8), $method: clip)} + +<===> clip/in_gamut/output.css +a { + b: color(srgb-linear 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> clip/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb-linear 1.5 0.5 0.8), $method: clip)} + +<===> clip/out_of_gamut/output.css +a { + b: color(srgb-linear 1 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/in_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb-linear 0.2 0.5 0.8), $method: local-minde)} + +<===> local_minde/in_gamut/output.css +a { + b: color(srgb-linear 0.2 0.5 0.8); +} + +<===> +================================================================================ +<===> local_minde/out_of_gamut/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb-linear 1.5 0.5 0.8), $method: local-minde)} + +<===> local_minde/out_of_gamut/output.css +a { + b: color(srgb-linear 1 0.6455185586 0.7900912983); +} + +<===> +================================================================================ +<===> local_minde/to_white/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb-linear 0.9 1.2 1.6), $method: local-minde)} + +<===> local_minde/to_white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> local_minde/to_black/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(srgb-linear 0 -0.05 -0.05), $method: local-minde)} + +<===> local_minde/to_black/output.css +a { + b: color(srgb-linear 0 0 0); +} diff --git a/spec/core_functions/color/to_gamut/xyz.hrx b/spec/core_functions/color/to_gamut/xyz.hrx new file mode 100644 index 0000000000..c94b5aec40 --- /dev/null +++ b/spec/core_functions/color/to_gamut/xyz.hrx @@ -0,0 +1,19 @@ +<===> clip/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(xyz 123 -456 999999), $method: clip)} + +<===> clip/output.css +a { + b: color(xyz 123 -456 999999); +} + +<===> +================================================================================ +<===> local_minde/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(xyz 123 -456 999999), $method: local-minde)} + +<===> local_minde/output.css +a { + b: color(xyz 123 -456 999999); +} diff --git a/spec/core_functions/color/to_gamut/xyz_d50.hrx b/spec/core_functions/color/to_gamut/xyz_d50.hrx new file mode 100644 index 0000000000..b382f29e4f --- /dev/null +++ b/spec/core_functions/color/to_gamut/xyz_d50.hrx @@ -0,0 +1,19 @@ +<===> clip/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(xyz-d50 123 -456 999999), $method: clip)} + +<===> clip/output.css +a { + b: color(xyz-d50 123 -456 999999); +} + +<===> +================================================================================ +<===> local_minde/input.scss +@use "sass:color"; +a {b: color.to-gamut(color(xyz-d50 123 -456 999999), $method: local-minde)} + +<===> local_minde/output.css +a { + b: color(xyz-d50 123 -456 999999); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/a98_rgb.hrx b/spec/core_functions/color/to_space/a98_rgb/a98_rgb.hrx new file mode 100644 index 0000000000..849e036c8f --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/a98_rgb.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), a98-rgb)} + +<===> in_range/output.css +a { + b: color(a98-rgb 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), a98-rgb)} + +<===> out_of_range/output.css +a { + b: color(a98-rgb -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/display_p3.hrx b/spec/core_functions/color/to_space/a98_rgb/display_p3.hrx new file mode 100644 index 0000000000..06e3aa43c5 --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.5039928958 0.5039928958 0.5039928958); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.1198075605 0.3936533835 0.7891199167); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -1.0713648823 0.3146416114 1.8898918553); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -352050.1162090242 -92416.3092975226 -70070.8047882944); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.0376331272 0.1827194825 0.2895249614 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.0376331272 0.1827194825 0.2895249614 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.1816774074 0.2892067467); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.080586652 none 0.2878991958); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.0376331272 0.1827194825 none); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/hsl.hrx b/spec/core_functions/color/to_space/a98_rgb/hsl.hrx new file mode 100644 index 0000000000..4953d6d219 --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 50.3992895764%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(206.798941326, 132.7737671841%, 35.0907131834%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(209.922630637, 396.8439205726%, 39.6562294521%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(0, 100%, -19096022.06943802%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(200.1785406812, 126.7161502744%, 13.1753745837%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(200.1785406812, 126.7161502744%, 13.1753745837%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(196.5051304863, 215.7701724503%, 9.4596338244%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(258.3433021907, 100%, 15.0612047755%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(125.1711076789, 146.5566174361%, 7.5605855126%); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/hwb.hrx b/spec/core_functions/color/to_space/a98_rgb/hwb.hrx new file mode 100644 index 0000000000..0ac786841b --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb 1 1 1), hwb)); + +<===> white/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(0, 0%, 50.3992895764%); + space: hwb; + channels: 0deg 50.3992895764% 49.6007104236% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: hsl(206.798941326, 132.7737671841%, 35.0907131834%); + space: hwb; + channels: 206.798941326deg -11.500548642% 18.3180249912% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(209.922630637, 396.8439205726%, 39.6562294521%); + space: hwb; + channels: 209.922630637deg -117.7171062569% -97.0295651612% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(0, 100%, -19096022.06943802%); + space: hwb; + channels: 180deg -38192044.13887604% 100% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(200.1785406812, 126.7161502744%, 13.1753745837%, 0.4); + space: hwb; + channels: 200.1785406812deg -3.519952873% 70.1292979595% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(200.1785406812, 126.7161502744%, 13.1753745837%, 0); + space: hwb; + channels: 200.1785406812deg -3.519952873% 70.1292979595% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(196.5051304863, 215.7701724503%, 9.4596338244%); + space: hwb; + channels: 196.5051304863deg -10.9514343917% 70.1292979595% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(a98-rgb 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(258.3433021907, 100%, 15.0612047755%); + space: hwb; + channels: 258.3433021907deg 0% 69.8775904491% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(125.1711076789, 146.5566174361%, 7.5605855126%); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/lab.hrx b/spec/core_functions/color/to_space/a98_rgb/lab.hrx new file mode 100644 index 0000000000..016a5d6a6c --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(53.7880481926% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(42.9339299516% 6.5030561424 -63.5427502212); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(30.0623308533% 38.5823326773 -241.4998540297); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -9041452038524.754 -4661998707364.328 -423818064305.84766) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(17.7387491045% -7.186319424 -22.7371258976 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(17.7387491045% -7.186319424 -22.7371258976 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(16.8147782656% -12.534270074 -24.2693697193); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: lab(5.8200823344% 29.1326658037 -42.4044732971); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(15.5541953165% -27.655552781 23.2496799552); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/lch.hrx b/spec/core_functions/color/to_space/a98_rgb/lch.hrx new file mode 100644 index 0000000000..13ece3e954 --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(53.7880481926% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(42.9339299516% 63.8746494696 275.8433881087deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(30.0623308533% 244.5624171683 279.0769417748deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -9041452038524.758 -4661998707364.329 -423818064305.86096) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(17.7387491045% 23.8457560364 252.4602846081deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(17.7387491045% 23.8457560364 252.4602846081deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(16.8147782656% 27.3150184488 242.6852480988deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: lch(5.8200823344% 51.4475613847 304.4897928318deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(15.5541953165% 36.1300043959 139.9466505913deg); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/oklab.hrx b/spec/core_functions/color/to_space/a98_rgb/oklab.hrx new file mode 100644 index 0000000000..fdca2567fb --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(60.1621101182% 0 0.0000000224); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(52.1495256905% -0.0513578757 -0.1793591779); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(38.583187128% -2.2710957934 -0.6509941262); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -9041452038524.754 -4661998707364.326 -423818064305.84424) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(29.182543438% -0.0383089973 -0.0634618836 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(29.182543438% -0.0383089973 -0.0634618836 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(28.2216457589% -0.0592406629 -0.068029159); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(20.9471844335% 0.0293694057 -0.1198702832); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(26.2341469735% -0.0807607241 0.059543982); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/oklch.hrx b/spec/core_functions/color/to_space/a98_rgb/oklch.hrx new file mode 100644 index 0000000000..9f2e1e6a2c --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(60.1621101182% 0.0000000224 89.8755628523deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(52.1495256905% 0.1865672696 254.0214147055deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(38.583187128% 2.3625557042 195.9945889447deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -9041452038524.746 -4661998707364.325 -423818064305.8496) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(29.182543438% 0.0741281994 238.8825662829deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(29.182543438% 0.0741281994 238.8825662829deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(28.2216457589% 0.0902076638 228.9502345148deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(20.9471844335% 0.1234157477 283.7668356322deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(26.2341469735% 0.1003383295 143.5990619106deg); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/prophoto_rgb.hrx b/spec/core_functions/color/to_space/a98_rgb/prophoto_rgb.hrx new file mode 100644 index 0000000000..1e9750e56b --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.4287509597 0.4287509597 0.4287509597); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.3168388393 0.3260606848 0.726820787); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -0.1930208925 0.2909921381 2.199240452); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -18118318.905084856 -7113714.776888951 -2671576.7208059593); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.1084709661 0.1348055136 0.2212739372 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.1084709661 0.1348055136 0.2212739372 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.1323881901 0.2209968271); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.0971986374 none 0.2172679015); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.0682396395 0.1289630742 none); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/rec2020.hrx b/spec/core_functions/color/to_space/a98_rgb/rec2020.hrx new file mode 100644 index 0000000000..77284b927c --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.4543095825 0.4543095825 0.4543095825); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.2185447527 0.3379568627 0.7598138887); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -0.8122496028 0.2467395561 2.013750701); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -898316.3792876494 -332882.1030921165 -174225.0344960701); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.0494709718 0.1182706557 0.2275848731 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.0494709718 0.1182706557 0.2275848731 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.116069056 0.2272691007); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.0393483967 none 0.2248497454); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.0350776367 0.1152389042 none); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/rgb.hrx b/spec/core_functions/color/to_space/a98_rgb/rgb.hrx new file mode 100644 index 0000000000..a2c0d680a7 --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(128.5181884199, 128.5181884199, 128.5181884199); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: hsl(206.798941326, 132.7737671841%, 35.0907131834%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(209.922630637, 396.8439205726%, 39.6562294521%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(0, 100%, -19096022.06943802%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(200.1785406812, 126.7161502744%, 13.1753745837%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(200.1785406812, 126.7161502744%, 13.1753745837%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 47.5348659402, 76.1702902033); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: rgb(23.4831395969, 0, 76.8121443549); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: hsl(129.5300952459, 146.5566174361%, 7.5605855126%); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/srgb.hrx b/spec/core_functions/color/to_space/a98_rgb/srgb.hrx new file mode 100644 index 0000000000..25fe9220d3 --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.5039928958 0.5039928958 0.5039928958); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), srgb)} + +<===> middle/output.css +a { + b: color(srgb -0.1150054864 0.4006209194 0.8168197501); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1.1771710626 0.4006209194 1.9702956516); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -381920.4413887605 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb -0.0351995287 0.186411239 0.2987070204 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb -0.0351995287 0.186411239 0.2987070204 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.186411239 0.2987070204); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.0920907435 none 0.3012240955); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb -0.0351995287 0.186411239 none); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/srgb_linear.hrx b/spec/core_functions/color/to_space/a98_rgb/srgb_linear.hrx new file mode 100644 index 0000000000..83a119d04f --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.2177555281 0.2177555281 0.2177555281); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear -0.012511378 0.1333039049 0.6327296478); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -1.4514581202 0.1333039049 4.7837263649); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -21924475654205.21 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear -0.0027244217 0.0290276622 0.0726003858 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear -0.0027244217 0.0290276622 0.0726003858 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.0290276622 0.0726003858); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.0088389143 none 0.073846514); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear -0.0027244217 0.0290276622 none); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/xyz.hrx b/spec/core_functions/color/to_space/a98_rgb/xyz.hrx new file mode 100644 index 0000000000..65d23f1fe4 --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.2069670324 0.2177555281 0.2371483457); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.1567033573 0.1383525888 0.6170771483); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.3124701203 0.1320464482 4.5349169732); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -9041452038524.758 -4661998707364.328 -423818064305.84784); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0223592858 0.0254215465 0.0724162815 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0223592858 0.0254215465 0.0724162815 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.0235420485 0.072245418); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.016972964 none 0.0703643493); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.0090314088 0.0200903956 none); +} diff --git a/spec/core_functions/color/to_space/a98_rgb/xyz_d50.hrx b/spec/core_functions/color/to_space/a98_rgb/xyz_d50.hrx new file mode 100644 index 0000000000..be6ccb697c --- /dev/null +++ b/spec/core_functions/color/to_space/a98_rgb/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.2099807143 0.2177555281 0.1796710885); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.1364163751 0.1311360929 0.4645989467); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 0.1028590408 0.062612892 3.4087872511); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -9560512850977.73 -4878046244787.3545 -305274677130.3227); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0203795694 0.0246044104 0.054623998 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0203795694 0.0246044104 0.054623998 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.0226378123 0.0545009257); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.0144201903 none 0.0528568205); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(a98-rgb 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.0098137269 0.0201278488 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/a98_rgb.hrx b/spec/core_functions/color/to_space/display_p3/a98_rgb.hrx new file mode 100644 index 0000000000..9bb4c67416 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.4961036984 0.4961036984 0.4961036984); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.2482053529 0.4050915621 0.8110198535); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -0.9267440317 0.459123582 2.1223637667); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -3115569.9464425035 788230.9760095418 569282.1313176785); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.1395855294 0.2151252811 0.3095213638 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.1395855294 0.2151252811 0.3095213638 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.2163312901 0.3099034883); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb 0.1153904633 none 0.3115106155); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.1395855294 0.2151252811 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/display_p3.hrx b/spec/core_functions/color/to_space/display_p3/display_p3.hrx new file mode 100644 index 0000000000..cc74a18d75 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/display_p3.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), display-p3)} + +<===> in_range/output.css +a { + b: color(display-p3 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), display-p3)} + +<===> out_of_range/output.css +a { + b: color(display-p3 -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/hsl.hrx b/spec/core_functions/color/to_space/display_p3/hsl.hrx new file mode 100644 index 0000000000..d276ccc3cd --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(214.974668252, 77.667451385%, 46.5940983001%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(210.5153182162, 325.7395089334%, 48.9349840904%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(356.7852726724, 165.043052964%, -41057989.10847678%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(205.417452683, 67.7488400949%, 18.4043245596%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(205.417452683, 67.7488400949%, 18.4043245596%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(196.0636856013, 172.1527011916%, 11.3581215767%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(262.3902012265, 103.5328302701%, 15.4158592357%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(96.0435532608, 143.3480015017%, 8.3456369204%); +} diff --git a/spec/core_functions/color/to_space/display_p3/hwb.hrx b/spec/core_functions/color/to_space/display_p3/hwb.hrx new file mode 100644 index 0000000000..08ec3b60a4 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 1 1 1), hwb)); + +<===> white/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(0, 0%, 50%); + space: hwb; + channels: 0deg 50% 50% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: hsl(214.974668252, 77.667451385%, 46.5940983001%); + space: hwb; + channels: 214.974668252deg 10.4056496546% 17.2174530544% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(210.5153182162, 325.7395089334%, 48.9349840904%); + space: hwb; + channels: 210.5153182162deg -110.4655927824% -108.3355609633% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(356.7852726724, 165.043052964%, -41057989.10847679%); + space: hwb; + channels: 176.7852726724deg -108821347.81871557% -26705269.601762004% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(205.417452683, 67.7488400949%, 18.4043245596%, 0.4); + space: hwb; + channels: 205.417452683deg 5.9356081432% 69.1269590239% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(205.417452683, 67.7488400949%, 18.4043245596%, 0); + space: hwb; + channels: 205.417452683deg 5.9356081432% 69.1269590239% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(196.0636856013, 172.1527011916%, 11.3581215767%); + space: hwb; + channels: 196.0636856013deg -8.1951915222% 69.0885653244% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(display-p3 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(262.3902012265, 103.5328302701%, 15.4158592357%); + space: hwb; + channels: 262.3902012265deg -0.5446161415% 68.6236653872% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(display-p3 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(96.0435532608, 143.3480015017%, 8.3456369204%); +} diff --git a/spec/core_functions/color/to_space/display_p3/lab.hrx b/spec/core_functions/color/to_space/display_p3/lab.hrx new file mode 100644 index 0000000000..b58a51efa4 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(53.3889647411% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(44.25592932% 9.6200905548 -62.9637824368); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(49.5672259701% 56.9674744357 -222.3639264513); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -107482877956690.4 -50580177881913.99 3039800.685913086) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(20.127570568% -5.1428777609 -20.6370940019 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(20.127570568% -5.1428777609 -20.6370940019 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(19.1369530209% -11.4360315052 -22.3500016909); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: lab(6.5882355616% 31.9260289697 -43.3240229048); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(18.0687084518% -22.5066779572 28.5560007052); +} diff --git a/spec/core_functions/color/to_space/display_p3/lch.hrx b/spec/core_functions/color/to_space/display_p3/lch.hrx new file mode 100644 index 0000000000..672ceba870 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(53.3889647411% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(44.25592932% 63.6944584797 278.686909273deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(49.5672259701% 229.5452219725 284.3695672545deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -107482896009634.61 -50580183886727.57 -376620475.52490234) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(20.127570568% 21.268258991 256.0066071682deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(20.127570568% 21.268258991 256.0066071682deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(19.1369530209% 25.1058836166 242.9021173179deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: lch(6.5882355616% 53.8167472672 306.386978589deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(18.0687084518% 36.3592591914 128.2437408357deg); +} diff --git a/spec/core_functions/color/to_space/display_p3/oklab.hrx b/spec/core_functions/color/to_space/display_p3/oklab.hrx new file mode 100644 index 0000000000..8d87bef4e2 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(59.8180726623% 0 0.0000000223); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(53.396034367% -0.0363375257 -0.1775421972); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(48.9249793468% -2.2018228016 -0.629877265); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -107482878101233.5 -50580177929992.28 0.0234375) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(31.275110206% -0.0275076842 -0.0572559178 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(31.275110206% -0.0275076842 -0.0572559178 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(30.2321904625% -0.0504866606 -0.0622983016); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(21.8336364075% 0.0395324831 -0.121787855); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(28.5078223716% -0.0706258662 0.0690953652); +} diff --git a/spec/core_functions/color/to_space/display_p3/oklch.hrx b/spec/core_functions/color/to_space/display_p3/oklch.hrx new file mode 100644 index 0000000000..69ae84b779 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(59.8180726623% 0.0000000223 89.8755628286deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(53.396034367% 0.1812226464 258.4330310876deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(48.9249793468% 2.2901460693 195.9642805578deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -107482878101233.53 -50580177929992.31 0.078125) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(31.275110206% 0.0635209636 244.3387920511deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(31.275110206% 0.0635209636 244.3387920511deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(30.2321904625% 0.0801871641 230.9786265053deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(21.8336364075% 0.1280433475 287.9834922303deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(28.5078223716% 0.0988037573 135.6275906956deg); +} diff --git a/spec/core_functions/color/to_space/display_p3/prophoto_rgb.hrx b/spec/core_functions/color/to_space/display_p3/prophoto_rgb.hrx new file mode 100644 index 0000000000..4647430450 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.4246723949 0.4246723949 0.4246723949); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.3388390747 0.3342960169 0.7393352444); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb 0.363190311 0.3948251642 2.3672559908); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -72137964.95638128 -23392436.47544621 2293597.437985952); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.1280122112 0.1488387497 0.2305514968 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.1280122112 0.1488387497 0.2305514968 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.1466998342 0.2305744173); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.1061223268 none 0.2275163591); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.0911473149 0.1429690366 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/rec2020.hrx b/spec/core_functions/color/to_space/display_p3/rec2020.hrx new file mode 100644 index 0000000000..6f5ae22185 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.4500400319 0.4500400319 0.4500400319); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.2536165098 0.3459256961 0.7717684009); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -0.699464711 0.3562683997 2.1433011781); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -2759152.3635634547 -781900.5819995644 152514.0918455245); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.0792630187 0.1360787348 0.2384262851 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.0792630187 0.1360787348 0.2384262851 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.1345809807 0.2384516749); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.0496776807 none 0.237203952); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.0635852545 0.1330813978 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/rgb.hrx b/spec/core_functions/color/to_space/display_p3/rgb.hrx new file mode 100644 index 0000000000..050651b9a5 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(127.5, 127.5, 127.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: rgb(26.5344066192, 103.5127809071, 211.0954947112); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(210.5153182162, 325.7395089334%, 48.9349840904%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(356.7852726724, 165.043052964%, -41057989.10847678%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: rgba(15.1358007651, 51.7877986787, 78.726254489, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: rgba(15.1358007651, 51.7877986787, 78.726254489, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 52.1258051255, 78.8241584227); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: rgb(28.9866805453, 0, 80.0096532626); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: rgb(15.1358007651, 51.7877986787, 0); +} diff --git a/spec/core_functions/color/to_space/display_p3/srgb.hrx b/spec/core_functions/color/to_space/display_p3/srgb.hrx new file mode 100644 index 0000000000..32ee1b1a8a --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.1040564965 0.4059324741 0.8278254695); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1.1046559278 0.4619691673 2.0833556096); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -1088213.4781871557 267053.69601762 194440.1223316972); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.0593560814 0.2030894066 0.3087304098 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.0593560814 0.2030894066 0.3087304098 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.2044149221 0.3091143468); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.113673257 none 0.3137633461); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb 0.0593560814 0.2030894066 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/srgb_linear.hrx b/spec/core_functions/color/to_space/display_p3/srgb_linear.hrx new file mode 100644 index 0000000000..9cf242227c --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.2140411405 0.2140411405 0.2140411405); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.0106639349 0.1370640729 0.6520692893); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -1.2548276 0.1805133132 5.4498673233); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -270587662527413.8 9290325591630.637 4337909799389.2847); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.0048307697 0.0340755227 0.07763636 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.0048307697 0.0340755227 0.07763636 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.0344970522 0.0778331838); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.0122773617 none 0.080239588); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear 0.0048307697 0.0340755227 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/xyz.hrx b/spec/core_functions/color/to_space/display_p3/xyz.hrx new file mode 100644 index 0000000000..b0c7795a36 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.2034366706 0.2140411405 0.233103163); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.171095654 0.1473658922 0.6363562895); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.5306657282 0.2557107148 5.1775335161); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -107482878101233.7 -50580177929992.33 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0281889097 0.0310017052 0.0779508635 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0281889097 0.0310017052 0.0779508635 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.0287067331 0.0779508635); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.0193940428 none 0.0764573956); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.0136716827 0.0251948144 none); +} diff --git a/spec/core_functions/color/to_space/display_p3/xyz_d50.hrx b/spec/core_functions/color/to_space/display_p3/xyz_d50.hrx new file mode 100644 index 0000000000..cff2de15b5 --- /dev/null +++ b/spec/core_functions/color/to_space/display_p3/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.2063989463 0.2140411405 0.1766063301); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.1507376549 0.1401604229 0.4790971056); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 0.3020960462 0.1805869911 3.8917991009); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -113795166948730.92 -53280831691639.766 231974346711.36108); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0263388599 0.0302094144 0.0588154349 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0263388599 0.0302094144 0.0588154349 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.0277919056 0.0588259602); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.0166719376 none 0.0574290645); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(display-p3 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.0148301452 0.0253333744 none); +} diff --git a/spec/core_functions/color/to_space/error.hrx b/spec/core_functions/color/to_space/error.hrx new file mode 100644 index 0000000000..a1c9b368b9 --- /dev/null +++ b/spec/core_functions/color/to_space/error.hrx @@ -0,0 +1,89 @@ +<===> undefined_space/input.scss +@use "sass:color"; +a {b: color.to-space(#abc, c)} + +<===> undefined_space/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.to-space(#abc, c)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> quoted_space/input.scss +@use "sass:color"; +a {b: color.to-space(#abc, "hsl")} + +<===> quoted_space/error +Error: $space: Expected "hsl" to be an unquoted string. + , +2 | a {b: color.to-space(#abc, "hsl")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> too_few_args/input.scss +@use "sass:color"; +a {b: color.to-space(#abc)} + +<===> too_few_args/error +Error: Missing argument $space. + ,--> input.scss +2 | a {b: color.to-space(#abc)} + | ^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function to-space($color, $space) { + | ======================== declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> too_many_args/input.scss +@use "sass:color"; +a {b: color.to-space(#abc, rgb, hsl)} + +<===> too_many_args/error +Error: Only 2 arguments allowed, but 3 were passed. + ,--> input.scss +2 | a {b: color.to-space(#abc, rgb, hsl)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation + ' + ,--> sass:color +1 | @function to-space($color, $space) { + | ======================== declaration + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/color/input.scss +@use "sass:color"; +a {b: color.to-space(1, rgb)} + +<===> type/color/error +Error: $color: 1 is not a color. + , +2 | a {b: color.to-space(1, rgb)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> type/space/input.scss +@use "sass:color"; +a {b: color.to-space(#abc, #def)} + +<===> type/space/error +Error: $space: #def is not a string. + , +2 | a {b: color.to-space(#abc, #def)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/to_space/hsl/a98_rgb.hrx b/spec/core_functions/color/to_space/hsl/a98_rgb.hrx new file mode 100644 index 0000000000..acb66a22d1 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/a98_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.4961036984 0.4961036984 0.4961036984); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.6581397554 0.7142002384 0.4892168037); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), a98-rgb)} + +<===> float/output.css +a { + b: color(a98-rgb 0.6777775446 0.5562111042 0.4789015947); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -1.3133426101 -0.1822173447 0.4856606142); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb 8698.1693722094 -3093.7862337018 -10082.3258830858); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.3376779392 0.2673823092 0.2497033225 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.3376779392 0.2673823092 0.2497033225 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), a98-rgb)} + +<===> missing/hue/output.css +a { + b: color(a98-rgb 0.333838384 0.2489105042 0.2489105042); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), a98-rgb)} + +<===> missing/saturation/output.css +a { + b: color(a98-rgb 0.3046424286 0.3046424286 0.3046424286); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), a98-rgb)} + +<===> missing/lightness/output.css +a { + b: color(a98-rgb 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/display_p3.hrx b/spec/core_functions/color/to_space/hsl/display_p3.hrx new file mode 100644 index 0000000000..e81c384dd7 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/display_p3.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.655133397 0.7175281483 0.505602812); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), display-p3)} + +<===> float/output.css +a { + b: color(display-p3 0.6997472063 0.5677618984 0.490693255); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -1.3795832908 -0.3608862783 0.4233635373); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 4579.6059857545 -1251.0810767168 -4781.6821693604); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.3447505085 0.2640504184 0.244140094 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.3447505085 0.2640504184 0.244140094 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), display-p3)} + +<===> missing/hue/output.css +a { + b: color(display-p3 0.3423085422 0.2451135243 0.2426469173); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), display-p3)} + +<===> missing/saturation/output.css +a { + b: color(display-p3 0.3 0.3 0.3); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), display-p3)} + +<===> missing/lightness/output.css +a { + b: color(display-p3 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/hsl.hrx b/spec/core_functions/color/to_space/hsl/hsl.hrx new file mode 100644 index 0000000000..d33b5731f9 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/hsl.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 20% 40%), hsl)} + +<===> in_range/output.css +a { + b: hsl(0, 20%, 40%); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), hsl)} + +<===> out_of_range/output.css +a { + b: hsl(20, 200%, -50%); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), hsl)} + +<===> missing/hue/output.css +a { + b: hsl(none 20% 30%); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), hsl)} + +<===> missing/saturation/output.css +a { + b: hsl(10deg none 30%); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), hsl)} + +<===> missing/lightness/output.css +a { + b: hsl(10deg 20% none); +} diff --git a/spec/core_functions/color/to_space/hsl/hwb.hrx b/spec/core_functions/color/to_space/hsl/hwb.hrx new file mode 100644 index 0000000000..72fc49f477 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/hwb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), hwb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), hwb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), hwb)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), hwb)} + +<===> middle/output.css +a { + b: hsl(80, 30%, 60%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), hwb)} + +<===> float/output.css +a { + b: hsl(20.123456789, 30.987654321%, 60.192837465%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), hwb)} + +<===> out_of_range/near/output.css +a { + b: hsl(20, 200%, -50%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), hwb)} + +<===> out_of_range/far/output.css +a { + b: hsl(20, 999999%, 50%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), hwb)} + +<===> alpha/partial/output.css +a { + b: hsla(10, 20%, 30%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), hwb)} + +<===> alpha/transparent/output.css +a { + b: hsla(10, 20%, 30%, 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), hwb)} + +<===> missing/hue/output.css +a { + b: hsl(0, 20%, 30%); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), hwb)} + +<===> missing/saturation/output.css +a { + b: hsl(0, 0%, 30%); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), hwb)} + +<===> missing/lightness/output.css +a { + b: black; +} diff --git a/spec/core_functions/color/to_space/hsl/lab.hrx b/spec/core_functions/color/to_space/hsl/lab.hrx new file mode 100644 index 0000000000..0325b86cb8 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/lab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), lab)} + +<===> gray/output.css +a { + b: lab(53.3889647411% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), lab)} + +<===> middle/output.css +a { + b: lab(71.9297767616% -15.056348508 28.7197360328); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), lab)} + +<===> float/output.css +a { + b: lab(63.0942649983% 14.1332827511 17.6588648805); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), lab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lab, color(xyz -1.0161268876 -0.540961491 0.1515884565) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz 136956388.39988723 59264689.52803929 -623200798.6169883) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(30.8688486066% 10.7899742234 7.6662278505 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(30.8688486066% 10.7899742234 7.6662278505 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), lab)} + +<===> missing/hue/output.css +a { + b: lab(29.467709003% 13.8451863493 5.7231513228); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), lab)} + +<===> missing/saturation/output.css +a { + b: lab(32.5331750598% 0 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), lab)} + +<===> missing/lightness/output.css +a { + b: lab(none 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/lch.hrx b/spec/core_functions/color/to_space/hsl/lch.hrx new file mode 100644 index 0000000000..d390e36ecf --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/lch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), lch)} + +<===> gray/output.css +a { + b: lch(53.3889647411% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), lch)} + +<===> middle/output.css +a { + b: lch(71.9297767616% 32.4271008292 117.6658176085deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), lch)} + +<===> float/output.css +a { + b: lch(63.0942649983% 22.6182490522 51.3279458157deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), lch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lch, color(xyz -1.0161268876 -0.540961491 0.1515884565) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz 136956388.67576775 59264689.51984791 -623200798.6134329) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(30.8688486066% 13.2361094434 35.393621554deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(30.8688486066% 13.2361094434 35.393621554deg / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), lch)} + +<===> missing/hue/output.css +a { + b: lch(29.467709003% 14.981443392 none); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), lch)} + +<===> missing/saturation/output.css +a { + b: lch(32.5331750598% none none); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), lch)} + +<===> missing/lightness/output.css +a { + b: lch(none 0 none); +} diff --git a/spec/core_functions/color/to_space/hsl/oklab.hrx b/spec/core_functions/color/to_space/hsl/oklab.hrx new file mode 100644 index 0000000000..d2ee1ffeaf --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/oklab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), oklab)} + +<===> gray/output.css +a { + b: oklab(59.8180726623% 0 0.0000000223); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), oklab)} + +<===> middle/output.css +a { + b: oklab(75.0578295808% -0.0474046375 0.0717748467); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), oklab)} + +<===> float/output.css +a { + b: oklab(68.4523446414% 0.0396042277 0.0440734803); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), oklab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklab, color(xyz -1.0161268876 -0.540961491 0.1515884565) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz 136956388.3998871 59264689.52803931 -623200798.6169885) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(40.6685296273% 0.0313239047 0.0191932237 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(40.6685296273% 0.0313239047 0.0191932237 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), oklab)} + +<===> missing/hue/output.css +a { + b: oklab(39.5815064245% 0.0409008812 0.014221487); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), oklab)} + +<===> missing/saturation/output.css +a { + b: oklab(41.838943744% 0 0.0000000156); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), oklab)} + +<===> missing/lightness/output.css +a { + b: oklab(none 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/oklch.hrx b/spec/core_functions/color/to_space/hsl/oklch.hrx new file mode 100644 index 0000000000..1f10c5d6c8 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/oklch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), oklch)} + +<===> gray/output.css +a { + b: oklch(59.8180726623% 0.0000000223 89.8755628286deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), oklch)} + +<===> middle/output.css +a { + b: oklch(75.0578295808% 0.0860164419 123.4432897448deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), oklch)} + +<===> float/output.css +a { + b: oklch(68.4523446414% 0.0592534093 48.0572806164deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), oklch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklch, color(xyz -1.0161268876 -0.540961491 0.1515884565) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz 136956388.39988703 59264689.52803931 -623200798.6169883) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(40.6685296273% 0.0367364512 31.4972209471deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(40.6685296273% 0.0367364512 31.4972209471deg / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), oklch)} + +<===> missing/hue/output.css +a { + b: oklch(39.5815064245% 0.0433028033 none); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), oklch)} + +<===> missing/saturation/output.css +a { + b: oklch(41.838943744% none 89.8755626743deg); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), oklch)} + +<===> missing/lightness/output.css +a { + b: oklch(none 0 none); +} diff --git a/spec/core_functions/color/to_space/hsl/prophoto_rgb.hrx b/spec/core_functions/color/to_space/hsl/prophoto_rgb.hrx new file mode 100644 index 0000000000..81453b78c9 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/prophoto_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.4246723949 0.4246723949 0.4246723949); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.583675038 0.6482529636 0.4440565473); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), prophoto-rgb)} + +<===> float/output.css +a { + b: color(prophoto-rgb 0.5797795588 0.5061830996 0.4192105931); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -1.16705518 -0.4773670849 0.334978827); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb 45494.0440115899 5344.0720850434 -73058.7852099565); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.2477526404 0.2091534142 0.1870234357 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.2477526404 0.2091534142 0.1870234357 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), prophoto-rgb)} + +<===> missing/hue/output.css +a { + b: color(prophoto-rgb 0.2432349971 0.1951926314 0.1850133783); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), prophoto-rgb)} + +<===> missing/saturation/output.css +a { + b: color(prophoto-rgb 0.2340459828 0.2340459828 0.2340459828); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), prophoto-rgb)} + +<===> missing/lightness/output.css +a { + b: color(prophoto-rgb 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/rec2020.hrx b/spec/core_functions/color/to_space/hsl/rec2020.hrx new file mode 100644 index 0000000000..ea2e1c3c9f --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/rec2020.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.4500400319 0.4500400319 0.4500400319); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.6252433371 0.6805013998 0.4608722597); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), rec2020)} + +<===> float/output.css +a { + b: color(rec2020 0.6312163333 0.5293329902 0.4413441586); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -1.2552227887 -0.4270321041 0.3660380417); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 7903.4152677186 -1170.118178736 -9706.8206181475); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.2670145784 0.2070036582 0.18272592 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.2670145784 0.2070036582 0.18272592 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), rec2020)} + +<===> missing/hue/output.css +a { + b: color(rec2020 0.2619751449 0.1889937521 0.1808798805); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), rec2020)} + +<===> missing/saturation/output.css +a { + b: color(rec2020 0.2397416118 0.2397416118 0.2397416118); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), rec2020)} + +<===> missing/lightness/output.css +a { + b: color(rec2020 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/rgb.hrx b/spec/core_functions/color/to_space/hsl/rgb.hrx new file mode 100644 index 0000000000..9c73be636d --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), rgb)} + +<===> gray/output.css +a { + b: rgb(127.5, 127.5, 127.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), rgb)} + +<===> middle/output.css +a { + b: rgb(163.2, 183.6, 122.4); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), rgb)} + +<===> float/output.css +a { + b: rgb(184.9467656352, 143.1361700697, 122.0367054363); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(20, 200%, -50%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(20, 999999%, 50%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: rgba(91.8, 66.3, 61.2, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: rgba(91.8, 66.3, 61.2, 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), rgb)} + +<===> missing/hue/output.css +a { + b: rgb(91.8, 61.2, 61.2); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), rgb)} + +<===> missing/saturation/output.css +a { + b: rgb(76.5, 76.5, 76.5); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), rgb)} + +<===> missing/lightness/output.css +a { + b: black; +} diff --git a/spec/core_functions/color/to_space/hsl/srgb.hrx b/spec/core_functions/color/to_space/hsl/srgb.hrx new file mode 100644 index 0000000000..3a71716158 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/srgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.64 0.72 0.48); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), srgb)} + +<===> float/output.css +a { + b: color(srgb 0.7252814339 0.561318314 0.4785753154); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1.5 -0.1666666667 0.5); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb 5000.495 -1666.165 -4999.495); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.36 0.26 0.24 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.36 0.26 0.24 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), srgb)} + +<===> missing/hue/output.css +a { + b: color(srgb 0.36 0.24 0.24); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), srgb)} + +<===> missing/saturation/output.css +a { + b: color(srgb 0.3 0.3 0.3); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), srgb)} + +<===> missing/lightness/output.css +a { + b: color(srgb 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/srgb_linear.hrx b/spec/core_functions/color/to_space/hsl/srgb_linear.hrx new file mode 100644 index 0000000000..8b50b8bcca --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/srgb_linear.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.2140411405 0.2140411405 0.2140411405); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.3672464682 0.4769997846 0.1959941793); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), srgb-linear)} + +<===> float/output.css +a { + b: color(srgb-linear 0.4848385603 0.2752493311 0.1947438934); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -2.5371552394 -0.0236523902 0.2140411405); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear 663493625.4651376 -47462621.32578329 -663175228.1293004); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.106539224 0.0549717327 0.0469642007 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.106539224 0.0549717327 0.0469642007 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), srgb-linear)} + +<===> missing/hue/output.css +a { + b: color(srgb-linear 0.106539224 0.0469642007 0.0469642007); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), srgb-linear)} + +<===> missing/saturation/output.css +a { + b: color(srgb-linear 0.0732389559 0.0732389559 0.0732389559); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), srgb-linear)} + +<===> missing/lightness/output.css +a { + b: color(srgb-linear 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/xyz.hrx b/spec/core_functions/color/to_space/hsl/xyz.hrx new file mode 100644 index 0000000000..60204e1778 --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/xyz.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.2034366706 0.2140411405 0.233103163); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.3573899014 0.4333755032 0.2502538283); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), xyz)} + +<===> float/output.css +a { + b: color(xyz 0.333515343 0.3140043025 0.2272909419); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz -1.0161268876 -0.540961491 0.1515884565); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz 136956388.39988744 59264689.52803937 -623200798.6169885); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0720689624 0.0653589105 0.0532528168 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0720689624 0.0653589105 0.0532528168 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), xyz)} + +<===> missing/hue/output.css +a { + b: color(xyz 0.0692055944 0.0596321744 0.0522983607); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), xyz)} + +<===> missing/saturation/output.css +a { + b: color(xyz 0.0696103997 0.0732389559 0.0797614526); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), xyz)} + +<===> missing/lightness/output.css +a { + b: color(xyz 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hsl/xyz_d50.hrx b/spec/core_functions/color/to_space/hsl/xyz_d50.hrx new file mode 100644 index 0000000000..6fa38d3f4c --- /dev/null +++ b/spec/core_functions/color/to_space/hsl/xyz_d50.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 0%), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 100%), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(0deg 0% 50%), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.2063989463 0.2140411405 0.1766063301); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(80deg 30% 60%), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.37190333 0.4355459142 0.1913805991); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20.123456789deg 30.987654321% 60.192837465%), xyz-d50)} + +<===> float/output.css +a { + b: color(xyz-d50 0.3452978329 0.3170012803 0.1725389126); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 200% -50%), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 -1.08485158 -0.5684806881 0.1152232851); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(20deg 999999% 50%), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 176160479.28127974 73395911.69654827 -468942304.8608692); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0743501157 0.0659597326 0.0403572779 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% 30% / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0743501157 0.0659597326 0.0403572779 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(none 20% 30%), xyz-d50)} + +<===> missing/hue/output.css +a { + b: color(xyz-d50 0.0712660027 0.0602192369 0.0395798961); +} + +<===> +================================================================================ +<===> missing/saturation/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg none 30%), xyz-d50)} + +<===> missing/saturation/output.css +a { + b: color(xyz-d50 0.0706240085 0.0732389559 0.0604297996); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(hsl(10deg 20% none), xyz-d50)} + +<===> missing/lightness/output.css +a { + b: color(xyz-d50 0 0 0); +} diff --git a/spec/core_functions/color/to_space/hwb/a98_rgb.hrx b/spec/core_functions/color/to_space/hwb/a98_rgb.hrx new file mode 100644 index 0000000000..ea088e39f6 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/a98_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.4961036984 0.4961036984 0.4961036984); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.505098443 0.5944145344 0.24376153); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), a98-rgb)} + +<===> float/output.css +a { + b: color(a98-rgb 0.5470366266 0.4056690546 0.3183176738); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb 2.295663911 2.1618962385 2.073992407); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb 21869.1993352833 21868.6190794601 21868.2300804636); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.6114401635 0.2890681375 0.2161347988 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.6114401635 0.2890681375 0.2161347988 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), a98-rgb)} + +<===> missing/hue/output.css +a { + b: color(a98-rgb 0.6038713799 0.2123166098 0.2123166098); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), a98-rgb)} + +<===> missing/whiteness/output.css +a { + b: color(a98-rgb 0.5990338556 0.1378605656 0.0323177975); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), a98-rgb)} + +<===> missing/blackness/output.css +a { + b: color(a98-rgb 0.8725825543 0.3359890414 0.2191164159); +} diff --git a/spec/core_functions/color/to_space/hwb/display_p3.hrx b/spec/core_functions/color/to_space/hwb/display_p3.hrx new file mode 100644 index 0000000000..eee8a6ccaa --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/display_p3.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.4937237179 0.5961714385 0.263280729); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), display-p3)} + +<===> float/output.css +a { + b: color(display-p3 0.5699167279 0.4147338146 0.3256408713); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 2.221649714 2.0891595287 2.0108056307); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 10000.4396382509 10000.1712862873 10000.0110201331); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.6499865104 0.3093627099 0.2280296402 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.6499865104 0.3093627099 0.2280296402 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), display-p3)} + +<===> missing/hue/output.css +a { + b: color(display-p3 0.6455550546 0.2397703326 0.2214676273); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), display-p3)} + +<===> missing/whiteness/output.css +a { + b: color(display-p3 0.6427370384 0.1801457354 0.0902798862); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), display-p3)} + +<===> missing/blackness/output.css +a { + b: color(display-p3 0.9253883052 0.3826332802 0.2571893552); +} diff --git a/spec/core_functions/color/to_space/hwb/hsl.hrx b/spec/core_functions/color/to_space/hwb/hsl.hrx new file mode 100644 index 0000000000..8ccc6eb685 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/hsl.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), hsl)} + +<===> middle/output.css +a { + b: hsl(80, 50%, 40%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), hsl)} + +<===> float/output.css +a { + b: hsl(20.123456789, 31.7413583858%, 45.397408428%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(200, 11.1111111111%, 212.5%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(200, 0.0025501925%, 1000024.4999999999%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(10, 55.5555555556%, 45%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(10, 55.5555555556%, 45%, 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), hsl)} + +<===> missing/hue/output.css +a { + b: hsl(0, 55.5555555556%, 45%); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), hsl)} + +<===> missing/whiteness/output.css +a { + b: hsl(10, 100%, 35%); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), hsl)} + +<===> missing/blackness/output.css +a { + b: hsl(10, 100%, 60%); +} diff --git a/spec/core_functions/color/to_space/hwb/hwb.hrx b/spec/core_functions/color/to_space/hwb/hwb.hrx new file mode 100644 index 0000000000..1f22a20797 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/hwb.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 20% 30%), hwb)} + +<===> in_range/output.css +a { + b: hsl(0, 55.5555555556%, 45%); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), hwb)} + +<===> out_of_range/output.css +a { + b: hsl(200, 11.1111111111%, 212.5%); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), hsl)} + +<===> missing/hue/output.css +a { + b: hsl(0, 55.5555555556%, 45%); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), hsl)} + +<===> missing/whiteness/output.css +a { + b: hsl(10, 100%, 35%); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), hsl)} + +<===> missing/blackness/output.css +a { + b: hsl(10, 100%, 60%); +} diff --git a/spec/core_functions/color/to_space/hwb/lab.hrx b/spec/core_functions/color/to_space/hwb/lab.hrx new file mode 100644 index 0000000000..6727778e5c --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/lab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), lab)} + +<===> gray/output.css +a { + b: lab(53.3889647411% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), lab)} + +<===> middle/output.css +a { + b: lab(59.1049141497% -23.929516442 47.3632808755); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), lab)} + +<===> float/output.css +a { + b: lab(48.7209664558% 18.0179342003 22.2207931535); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), lab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lab, color(xyz 5.5338099778 5.6426521513 5.4845096668) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz 3327825161.664072 3501247104.3035965 3812875110.896886) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(45.4228859316% 43.1656753022 35.3539928676 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(45.4228859316% 43.1656753022 35.3539928676 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), lab)} + +<===> missing/hue/output.css +a { + b: lab(42.0638915398% 51.8940588399 31.6507145358); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), lab)} + +<===> missing/whiteness/output.css +a { + b: lab(39.3870160342% 57.3703400949 53.7905111747); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), lab)} + +<===> missing/blackness/output.css +a { + b: lab(60.7483623827% 64.2863186591 55.7098309346); +} diff --git a/spec/core_functions/color/to_space/hwb/lch.hrx b/spec/core_functions/color/to_space/hwb/lch.hrx new file mode 100644 index 0000000000..14727618c4 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/lch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), lch)} + +<===> gray/output.css +a { + b: lch(53.3889647411% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), lch)} + +<===> middle/output.css +a { + b: lch(59.1049141497% 53.0650745071 116.8044348895deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), lch)} + +<===> float/output.css +a { + b: lch(48.7209664558% 28.6078590813 50.9628149158deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), lch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lch, color(xyz 5.5338099778 5.6426521513 5.4845096668) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz 3327825161.664072 3501247104.3035965 3812875110.896886) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(45.4228859316% 55.7958809947 39.3185127962deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(45.4228859316% 55.7958809947 39.3185127962deg / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), lch)} + +<===> missing/hue/output.css +a { + b: lch(42.0638915398% 60.7845463379 none); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), lch)} + +<===> missing/whiteness/output.css +a { + b: lch(39.3870160342% 78.6433405639 43.1554816825deg); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), lch)} + +<===> missing/blackness/output.css +a { + b: lch(60.7483623827% 85.0665388358 40.9118491907deg); +} diff --git a/spec/core_functions/color/to_space/hwb/oklab.hrx b/spec/core_functions/color/to_space/hwb/oklab.hrx new file mode 100644 index 0000000000..d37240ef28 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/oklab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), oklab)} + +<===> gray/output.css +a { + b: oklab(59.8180726623% 0 0.0000000223); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), oklab)} + +<===> middle/output.css +a { + b: oklab(63.6472338735% -0.0788719974 0.109198804); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), oklab)} + +<===> float/output.css +a { + b: oklab(56.1528329965% 0.0492061827 0.0538160955); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), oklab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklab, color(xyz 5.5338099778 5.6426521513 5.4845096668) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz 3327825161.6640716 3501247104.3035994 3812875110.896889) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(54.0481985043% 0.1200265651 0.0782231914 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(54.0481985043% 0.1200265651 0.0782231914 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), oklab)} + +<===> missing/hue/output.css +a { + b: oklab(51.4791394597% 0.1488491412 0.0695742279); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), oklab)} + +<===> missing/whiteness/output.css +a { + b: oklab(49.2675905721% 0.1574612806 0.0989515664); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), oklab)} + +<===> missing/blackness/output.css +a { + b: oklab(67.8199997859% 0.1771510758 0.1158916741); +} diff --git a/spec/core_functions/color/to_space/hwb/oklch.hrx b/spec/core_functions/color/to_space/hwb/oklch.hrx new file mode 100644 index 0000000000..34fea9de33 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/oklch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), oklch)} + +<===> gray/output.css +a { + b: oklch(59.8180726623% 0.0000000223 89.8755628286deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), oklch)} + +<===> middle/output.css +a { + b: oklch(63.6472338735% 0.1347040117 125.8397889312deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), oklch)} + +<===> float/output.css +a { + b: oklch(56.1528329965% 0.0729206456 47.5620912167deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), oklch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklch, color(xyz 5.5338099778 5.6426521513 5.4845096668) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz 3327825161.6640716 3501247104.3035994 3812875110.896889) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(54.0481985043% 0.1432663394 33.0929168902deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(54.0481985043% 0.1432663394 33.0929168902deg / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), oklch)} + +<===> missing/hue/output.css +a { + b: oklch(51.4791394597% 0.1643065429 none); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), oklch)} + +<===> missing/whiteness/output.css +a { + b: oklch(49.2675905721% 0.1859716843 32.1460100423deg); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), oklch)} + +<===> missing/blackness/output.css +a { + b: oklch(67.8199997859% 0.2116917187 33.1925848215deg); +} diff --git a/spec/core_functions/color/to_space/hwb/prophoto_rgb.hrx b/spec/core_functions/color/to_space/hwb/prophoto_rgb.hrx new file mode 100644 index 0000000000..5210e50f74 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/prophoto_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.4246723949 0.4246723949 0.4246723949); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.4173696362 0.5097373596 0.226865426); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), prophoto-rgb)} + +<===> float/output.css +a { + b: color(prophoto-rgb 0.4353235123 0.3529407495 0.2611635846); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb 2.6931467502 2.5889839276 2.4557122588); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb 200609.520572436 200606.1129393156 200601.5646967502); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.4764700867 0.2813317076 0.1760974536 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.4764700867 0.2813317076 0.1760974536 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), prophoto-rgb)} + +<===> missing/hue/output.css +a { + b: color(prophoto-rgb 0.4657013132 0.2352440242 0.1674964522); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), prophoto-rgb)} + +<===> missing/whiteness/output.css +a { + b: color(prophoto-rgb 0.4539567276 0.2001286929 0.0733250158); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), prophoto-rgb)} + +<===> missing/blackness/output.css +a { + b: color(prophoto-rgb 0.7274254108 0.3840965619 0.2020562891); +} diff --git a/spec/core_functions/color/to_space/hwb/rec2020.hrx b/spec/core_functions/color/to_space/hwb/rec2020.hrx new file mode 100644 index 0000000000..62eb282405 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/rec2020.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.4500400319 0.4500400319 0.4500400319); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.459214681 0.5459336036 0.2122890002); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), rec2020)} + +<===> float/output.css +a { + b: color(rec2020 0.4867284206 0.3676626536 0.2677057789); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 2.3816237298 2.2717034049 2.1734869236); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 21678.0429642711 21677.6112716515 21677.2173996703); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.5439867892 0.2751629629 0.1667560186 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.5439867892 0.2751629629 0.1667560186 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), rec2020)} + +<===> missing/hue/output.css +a { + b: color(rec2020 0.5338070059 0.2147334666 0.158678854); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), rec2020)} + +<===> missing/whiteness/output.css +a { + b: color(rec2020 0.5258638966 0.1667450692 0.0381165436); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), rec2020)} + +<===> missing/blackness/output.css +a { + b: color(rec2020 0.8117472221 0.3730204781 0.1963814934); +} diff --git a/spec/core_functions/color/to_space/hwb/rgb.hrx b/spec/core_functions/color/to_space/hwb/rgb.hrx new file mode 100644 index 0000000000..86fe7740ba --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), rgb)} + +<===> gray/output.css +a { + b: rgb(127.5, 127.5, 127.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), rgb)} + +<===> middle/output.css +a { + b: #779933; +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), rgb)} + +<===> float/output.css +a { + b: rgb(152.5082644643, 103.6663139681, 79.0185185186); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(200, 11.1111111111%, 212.5%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(200, 0.0025501925%, 1000024.4999999999%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: rgba(178.5, 72.25, 51, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: rgba(178.5, 72.25, 51, 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), rgb)} + +<===> missing/hue/output.css +a { + b: rgb(178.5, 51, 51); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), rgb)} + +<===> missing/whiteness/output.css +a { + b: rgb(178.5, 29.75, 0); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), rgb)} + +<===> missing/blackness/output.css +a { + b: #ff5533; +} diff --git a/spec/core_functions/color/to_space/hwb/srgb.hrx b/spec/core_functions/color/to_space/hwb/srgb.hrx new file mode 100644 index 0000000000..a74be0c73d --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/srgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.4666666667 0.6 0.2); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), srgb)} + +<===> float/output.css +a { + b: color(srgb 0.5980716254 0.4065345646 0.3098765432); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb 2.25 2.0833333333 2); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb 10000.5 10000.16 9999.99); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.7 0.2833333333 0.2 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.7 0.2833333333 0.2 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), srgb)} + +<===> missing/hue/output.css +a { + b: color(srgb 0.7 0.2 0.2); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), srgb)} + +<===> missing/whiteness/output.css +a { + b: color(srgb 0.7 0.1166666667 0); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), srgb)} + +<===> missing/blackness/output.css +a { + b: color(srgb 1 0.3333333333 0.2); +} diff --git a/spec/core_functions/color/to_space/hwb/srgb_linear.hrx b/spec/core_functions/color/to_space/hwb/srgb_linear.hrx new file mode 100644 index 0000000000..8fc58e015d --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/srgb_linear.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.2140411405 0.2140411405 0.2140411405); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.1844749945 0.3185467781 0.0331047666); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), srgb-linear)} + +<===> float/output.css +a { + b: color(srgb-linear 0.316300627 0.1374941598 0.0782247825); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear 6.5253577732 5.4497310669 4.9538457516); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear 3501482364.2479005 3501196665.942984 3501053821.890021); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.4479884124 0.0652561709 0.0331047666 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.4479884124 0.0652561709 0.0331047666 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), srgb-linear)} + +<===> missing/hue/output.css +a { + b: color(srgb-linear 0.4479884124 0.0331047666 0.0331047666); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), srgb-linear)} + +<===> missing/whiteness/output.css +a { + b: color(srgb-linear 0.4479884124 0.0128067943 0); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), srgb-linear)} + +<===> missing/blackness/output.css +a { + b: color(srgb-linear 1 0.0908417112 0.0331047666); +} diff --git a/spec/core_functions/color/to_space/hwb/xyz.hrx b/spec/core_functions/color/to_space/hwb/xyz.hrx new file mode 100644 index 0000000000..57672f1371 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/xyz.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.2034366706 0.2140411405 0.233103163); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.195957904 0.2694311676 0.0730023108); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), xyz)} + +<===> float/output.css +a { + b: color(xyz 0.1937232971 0.1712365957 0.0968581071); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 5.5338099778 5.6426521513 5.4845096668); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz 3327825161.6640773 3501247104.3036017 3812875110.896892); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.2140556586 0.14431889 0.0479053227 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.2140556586 0.14431889 0.0479053227 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), xyz)} + +<===> missing/hue/output.css +a { + b: color(xyz 0.2025588199 0.1213252126 0.0440730432); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), xyz)} + +<===> missing/whiteness/output.css +a { + b: color(xyz 0.1893258086 0.1044188288 0.0101864858); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), xyz)} + +<===> missing/blackness/output.css +a { + b: color(xyz 0.4508491469 0.2799960622 0.0616258215); +} diff --git a/spec/core_functions/color/to_space/hwb/xyz_d50.hrx b/spec/core_functions/color/to_space/hwb/xyz_d50.hrx new file mode 100644 index 0000000000..d3b7c53e22 --- /dev/null +++ b/spec/core_functions/color/to_space/hwb/xyz_d50.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 0% 100%), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 100% 0%), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(0deg 50% 50%), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.2063989463 0.2140411405 0.1766063301); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(80deg 20% 40%), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.2078685764 0.2714132806 0.0571336509); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20.123456789deg 30.987654321% 40.192837465%), xyz-d50)} + +<===> float/output.css +a { + b: color(xyz-d50 0.2020762306 0.1736844804 0.0736125271); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 200% -125%), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 5.6532455812 5.6589901967 4.1574637428); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(20deg 999999% -999950%), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 3376292952.6417513 3501251572.6872187 2888755456.5582485); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.2252224921 0.1484624713 0.0362130035 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% 30% / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.2252224921 0.1484624713 0.0362130035 / 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(none 20% 30%), xyz-d50)} + +<===> missing/hue/output.css +a { + b: color(xyz-d50 0.2128393302 0.1254135471 0.0330917026); +} + +<===> +================================================================================ +<===> missing/whiteness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg none 30%), xyz-d50)} + +<===> missing/whiteness/output.css +a { + b: color(xyz-d50 0.2002849578 0.1088553897 0.007481056); +} + +<===> +================================================================================ +<===> missing/blackness/input.scss +@use "sass:color"; +a {b: color.to-space(hwb(10deg 20% none), xyz-d50)} + +<===> missing/blackness/output.css +a { + b: color(xyz-d50 0.4757901468 0.2896232248 0.0463830476); +} diff --git a/spec/core_functions/color/to_space/lab/a98_rgb.hrx b/spec/core_functions/color/to_space/lab/a98_rgb.hrx new file mode 100644 index 0000000000..0272e26384 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.4633483808 0.4633483808 0.4633483808); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.4993446464 0.3405847685 0.9621105751); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -0.3527883779 -0.1750269182 -0.4390573819); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -16.6598712578 12.1485560974 -2.4112643287); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.2039535001 0.0808226659 -0.1242620432 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.2039535001 0.0808226659 -0.1242620432 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), a98-rgb)} + +<===> missing/lightness/output.css +a { + b: color(a98-rgb 0.1487894196 -0.0929319593 -0.1737307511); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), a98-rgb)} + +<===> missing/a/output.css +a { + b: color(a98-rgb 0.1557107469 0.1271683781 -0.125356279); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), a98-rgb)} + +<===> missing/b/output.css +a { + b: color(a98-rgb 0.1862731835 0.0856347366 0.1310611506); +} diff --git a/spec/core_functions/color/to_space/lab/display_p3.hrx b/spec/core_functions/color/to_space/lab/display_p3.hrx new file mode 100644 index 0000000000..be7746f843 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.4663266093 0.4663266093 0.4663266093); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.5227133162 0.348060966 0.9452485417); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -0.3704020725 -0.1731154433 -0.4345219765); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -15.0614491889 9.7148006078 -2.8909250239); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.2036678394 0.0627355423 -0.092163728 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.2036678394 0.0627355423 -0.092163728 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), display-p3)} + +<===> missing/lightness/output.css +a { + b: color(display-p3 0.1438618115 -0.0552726461 -0.1517242634); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), display-p3)} + +<===> missing/a/output.css +a { + b: color(display-p3 0.1411767229 0.1061424169 -0.0944472015); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), display-p3)} + +<===> missing/b/output.css +a { + b: color(display-p3 0.1823778479 0.0651398083 0.1096920557); +} diff --git a/spec/core_functions/color/to_space/lab/hsl.hrx b/spec/core_functions/color/to_space/lab/hsl.hrx new file mode 100644 index 0000000000..918bf4c441 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 46.6326609284%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), hsl)} + +<===> middle/output.css +a { + b: hsl(260.0900301863, 93.9881625698%, 65.88440774%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(289.8791142497, 47.7721599837%, -30.374201454%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(329.5753543003, 419.147137703%, -324.1554346051%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(28.3698264077, 277.3239474447%, 5.9154081349%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(28.3698264077, 277.3239474447%, 5.9154081349%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), hsl)} + +<===> missing/lightness/output.css +a { + b: hsl(17.5913578322, 6051.6428880588%, 0%); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), hsl)} + +<===> missing/a/output.css +a { + b: hsl(49.7972674498, 639.4765067331%, 2.0005058387%); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), hsl)} + +<===> missing/b/output.css +a { + b: hsl(337.1245847104, 56.1707811732%, 12.7694440441%); +} diff --git a/spec/core_functions/color/to_space/lab/hwb.hrx b/spec/core_functions/color/to_space/lab/hwb.hrx new file mode 100644 index 0000000000..2c4f540cfb --- /dev/null +++ b/spec/core_functions/color/to_space/lab/hwb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), hwb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), hwb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), hwb)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 46.6326609284%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), hwb)} + +<===> middle/output.css +a { + b: hsl(260.0900301863, 93.9881625698%, 65.88440774%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), hwb)} + +<===> out_of_range/near/output.css +a { + b: hsl(289.8791142497, 47.7721599837%, -30.374201454%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), hwb)} + +<===> out_of_range/far/output.css +a { + b: hsl(329.5753543003, 419.147137703%, -324.1554346051%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), hwb)} + +<===> alpha/partial/output.css +a { + b: hsla(28.3698264077, 277.3239474447%, 5.9154081349%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), hwb)} + +<===> alpha/transparent/output.css +a { + b: hsla(28.3698264077, 277.3239474447%, 5.9154081349%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), hwb)} + +<===> missing/lightness/output.css +a { + b: hsl(17.5913578322, 6051.6428880587%, 0.2688304082%); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), hwb)} + +<===> missing/a/output.css +a { + b: hsl(49.7972674498, 639.4765067331%, 2.0005058387%); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), hwb)} + +<===> missing/b/output.css +a { + b: hsl(337.1245847104, 56.1707811732%, 12.7694440441%); +} diff --git a/spec/core_functions/color/to_space/lab/lab.hrx b/spec/core_functions/color/to_space/lab/lab.hrx new file mode 100644 index 0000000000..353a128071 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/lab.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), lab)} + +<===> in_range/output.css +a { + b: lab(50% 50 -75); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -150 150), lab)} + +<===> out_of_range/output.css +a { + b: lab(50% -150 150); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), lab)} + +<===> missing/lightness/output.css +a { + b: lab(none 20 30); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), lab)} + +<===> missing/a/output.css +a { + b: lab(10% none 30); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), lab)} + +<===> missing/b/output.css +a { + b: lab(10% 20 none); +} diff --git a/spec/core_functions/color/to_space/lab/lch.hrx b/spec/core_functions/color/to_space/lab/lch.hrx new file mode 100644 index 0000000000..a243afde88 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), lch)} + +<===> gray/output.css +a { + b: lch(50% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), lch)} + +<===> middle/output.css +a { + b: lch(50% 90.1387818866 303.690067526deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), lch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lch, color(xyz -0.0931334424 -0.0559710307 -0.1664628061) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), lch)} + +<===> out_of_range/far/output.css +a { + b: lch(50% 999999 180deg); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(10% 36.0555127546 56.309932474deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(10% 36.0555127546 56.309932474deg / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), lch)} + +<===> missing/lightness/output.css +a { + b: lch(none 36.0555127546 56.309932474deg); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), lch)} + +<===> missing/a/output.css +a { + b: lch(10% 30 90deg); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), lch)} + +<===> missing/b/output.css +a { + b: lch(10% 20 0deg); +} diff --git a/spec/core_functions/color/to_space/lab/oklab.hrx b/spec/core_functions/color/to_space/lab/oklab.hrx new file mode 100644 index 0000000000..2e342d0a72 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), oklab)} + +<===> gray/output.css +a { + b: oklab(56.8965513528% 0 0.0000000212); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), oklab)} + +<===> middle/output.css +a { + b: oklab(60.2352362176% 0.0926046157 -0.2110438209); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), oklab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklab, color(xyz -0.0931334424 -0.0559710307 -0.1664628061) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -236.5825482412 7.2139420412 -2.8507109462) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(22.8064235198% -0.061853134 0.2798052355 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(22.8064235198% -0.061853134 0.2798052355 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), oklab)} + +<===> missing/lightness/output.css +a { + b: oklab(none 0.4936529727 0.1158908016); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), oklab)} + +<===> missing/a/output.css +a { + b: oklab(22.1884319419% none 0.2838925277); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), oklab)} + +<===> missing/b/output.css +a { + b: oklab(23.0834632697% 0.0614345595 none); +} diff --git a/spec/core_functions/color/to_space/lab/oklch.hrx b/spec/core_functions/color/to_space/lab/oklch.hrx new file mode 100644 index 0000000000..3cb945ea0c --- /dev/null +++ b/spec/core_functions/color/to_space/lab/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), oklch)} + +<===> gray/output.css +a { + b: oklch(56.8965513528% 0.0000000212 89.8755629589deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), oklch)} + +<===> middle/output.css +a { + b: oklch(60.2352362176% 0.2304671542 293.6915443769deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), oklch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklch, color(xyz -0.0931334424 -0.0559710307 -0.1664628061) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -236.5825482412 7.2139420412 -2.8507109462) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(22.8064235198% 0.2865602554 102.4652159995deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(22.8064235198% 0.2865602554 102.4652159995deg / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), oklch)} + +<===> missing/lightness/output.css +a { + b: oklch(none 0.5070738953 13.2116104316deg); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), oklch)} + +<===> missing/a/output.css +a { + b: oklch(22.1884319419% 0.3083157518 112.9588813999deg); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), oklch)} + +<===> missing/b/output.css +a { + b: oklch(23.0834632697% 0.0614385657 359.3456866656deg); +} diff --git a/spec/core_functions/color/to_space/lab/prophoto_rgb.hrx b/spec/core_functions/color/to_space/lab/prophoto_rgb.hrx new file mode 100644 index 0000000000..ce3cc40c43 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.3906698633 0.3906698633 0.3906698633); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.5179210602 0.3284958504 0.9083646327); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -0.2802411013 -0.1595613747 -0.3507026734); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -25.2096957329 15.2674513494 0.3906698633); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.1181031255 0.0643408567 -0.0693072402 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.1181031255 0.0643408567 -0.0693072402 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), prophoto-rgb)} + +<===> missing/lightness/output.css +a { + b: color(prophoto-rgb 0.0658841117 -0.0398403518 -0.1114464198); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), prophoto-rgb)} + +<===> missing/a/output.css +a { + b: color(prophoto-rgb 0.085998245 0.0813505708 -0.0693072402); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), prophoto-rgb)} + +<===> missing/b/output.css +a { + b: color(prophoto-rgb 0.1155645311 0.0659678734 0.0827038254); +} diff --git a/spec/core_functions/color/to_space/lab/rec2020.hrx b/spec/core_functions/color/to_space/lab/rec2020.hrx new file mode 100644 index 0000000000..5ea39671eb --- /dev/null +++ b/spec/core_functions/color/to_space/lab/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.4141328903 0.4141328903 0.4141328903); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.4782548936 0.3165685667 0.9316090731); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -0.2868532205 -0.1310027915 -0.3772590396); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -16.3406051212 10.9684505106 -2.5677472313); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.115034011 0.0285101795 -0.0389460082 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.115034011 0.0285101795 -0.0389460082 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), rec2020)} + +<===> missing/lightness/output.css +a { + b: color(rec2020 0.0535921266 -0.0161333028 -0.0888018246); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), rec2020)} + +<===> missing/a/output.css +a { + b: color(rec2020 0.0677133777 0.0497451668 -0.0398688899); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), rec2020)} + +<===> missing/b/output.css +a { + b: color(rec2020 0.1006265985 0.0294359094 0.0515937784); +} diff --git a/spec/core_functions/color/to_space/lab/rgb.hrx b/spec/core_functions/color/to_space/lab/rgb.hrx new file mode 100644 index 0000000000..ffffab524c --- /dev/null +++ b/spec/core_functions/color/to_space/lab/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), rgb)} + +<===> gray/output.css +a { + b: rgb(118.9132853673, 118.9132853673, 118.9132853673); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), rgb)} + +<===> middle/output.css +a { + b: rgb(140.9956907717, 86.2404630336, 249.7700164402); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(289.8791142497, 47.7721599837%, -30.374201454%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(329.5753543003, 419.147137703%, -324.1554346051%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(28.3698264077, 277.3239474447%, 5.9154081349%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(28.3698264077, 277.3239474447%, 5.9154081349%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), rgb)} + +<===> missing/lightness/output.css +a { + b: hsl(17.5913578322, 6051.6428880588%, 0.2688304082%); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), rgb)} + +<===> missing/a/output.css +a { + b: hsl(49.7972674498, 639.4765067331%, 2.0005058387%); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), rgb)} + +<===> missing/b/output.css +a { + b: rgb(50.8524583137, 14.2717063113, 28.2183712056); +} diff --git a/spec/core_functions/color/to_space/lab/srgb.hrx b/spec/core_functions/color/to_space/lab/srgb.hrx new file mode 100644 index 0000000000..937766a819 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.4663266093 0.4663266093 0.4663266093); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.5529242775 0.3381978942 0.9794902605); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -0.3998933946 -0.1586378934 -0.4488461357); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -16.8284366046 10.3453279125 -3.4338747169); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.2232025148 0.0502398339 -0.1048943521 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.2232025148 0.0502398339 -0.1048943521 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), srgb)} + +<===> missing/lightness/output.css +a { + b: color(srgb 0.1653748669 -0.0646023407 -0.1599982587); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), srgb)} + +<===> missing/a/output.css +a { + b: color(srgb 0.1479327069 0.1044256541 -0.1079225902); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), srgb)} + +<===> missing/b/output.css +a { + b: color(srgb 0.1994214052 0.0559674757 0.1106602792); +} diff --git a/spec/core_functions/color/to_space/lab/srgb_linear.hrx b/spec/core_functions/color/to_space/lab/srgb_linear.hrx new file mode 100644 index 0000000000..991959b87b --- /dev/null +++ b/spec/core_functions/color/to_space/lab/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.1841865185 0.1841865185 0.1841865185); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.2663378358 0.0935967862 0.9539760505); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -0.1327936201 -0.0216482097 -0.1697106644); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -776.4261256147 242.720788708 -17.6457042383); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.040800043 0.0039575505 -0.01079925 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.040800043 0.0039575505 -0.01079925 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), srgb-linear)} + +<===> missing/lightness/output.css +a { + b: color(srgb-linear 0.0233229267 -0.0053798396 -0.0219805198); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), srgb-linear)} + +<===> missing/a/output.css +a { + b: color(srgb-linear 0.0191354647 0.0107234318 -0.0112966385); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), srgb-linear)} + +<===> missing/b/output.css +a { + b: color(srgb-linear 0.0329247775 0.004494318 0.0117575878); +} diff --git a/spec/core_functions/color/to_space/lab/xyz.hrx b/spec/core_functions/color/to_space/lab/xyz.hrx new file mode 100644 index 0000000000..6bee277bf2 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.1750611682 0.1841865185 0.2005897556); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.3154783677 0.1924410425 0.9230896852); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz -0.0931334424 -0.0559710307 -0.1664628061); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -236.5825482412 7.2139420412 -2.8507109462); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0162916633 0.0107263739 -0.0090046167 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0162916633 0.0107263739 -0.0090046167 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), xyz)} + +<===> missing/lightness/output.css +a { + b: color(xyz 0.0037273525 -0.0004749534 -0.0210835883); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), xyz)} + +<===> missing/a/output.css +a { + b: color(xyz 0.0096869946 0.0109224783 -0.0090897368); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), xyz)} + +<===> missing/b/output.css +a { + b: color(xyz 0.0173069918 0.0110640949 0.0123481274); +} diff --git a/spec/core_functions/color/to_space/lab/xyz_d50.hrx b/spec/core_functions/color/to_space/lab/xyz_d50.hrx new file mode 100644 index 0000000000..349ee58cb1 --- /dev/null +++ b/spec/core_functions/color/to_space/lab/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lab(0% 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lab(100% 0 0), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 0 0), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.1776102635 0.1841865185 0.1519731441); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% 50 -75), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.2886831368 0.1841865185 0.6940286511); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lab(0% -150 150), $lightness: -50%), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 -0.0905265235 -0.055352823 -0.1251409211); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lab(50% -999999 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -247.6132796606 0.1841865185 0.1519731441); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0177706181 0.0112601993 -0.0067594366 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 30 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0177706181 0.0112601993 -0.0067594366 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lab(none 20 30), xyz-d50)} + +<===> missing/lightness/output.css +a { + b: color(xyz-d50 0.0049533381 0 -0.0158938104); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% none 30), xyz-d50)} + +<===> missing/a/output.css +a { + b: color(xyz-d50 0.0108581615 0.0112601993 -0.0067594366); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(lab(10% 20 none), xyz-d50)} + +<===> missing/b/output.css +a { + b: color(xyz-d50 0.0177706181 0.0112601993 0.0092908422); +} diff --git a/spec/core_functions/color/to_space/lch/a98_rgb.hrx b/spec/core_functions/color/to_space/lch/a98_rgb.hrx new file mode 100644 index 0000000000..36751b4315 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/a98_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.4633483808 0.4633483808 0.4633483808); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.1855277377 0.0926913904 0.0818650595); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), a98-rgb)} + +<===> float/output.css +a { + b: color(a98-rgb 0.1889263665 0.0909755641 0.0795209428); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb 0.4634940567 -0.3642836921 -0.1126427123); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb 42562.6792376747 -31021.1046455384 6233.1625417899); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.1855277377 0.0926913904 0.0818650595 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.1855277377 0.0926913904 0.0818650595 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), a98-rgb)} + +<===> missing/lightness/output.css +a { + b: color(a98-rgb 0.1244563961 -0.084601587 -0.1049078937); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), a98-rgb)} + +<===> missing/chroma/output.css +a { + b: color(a98-rgb 0.1300242938 0.1300242938 0.1300242938); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), a98-rgb)} + +<===> missing/hue/output.css +a { + b: color(a98-rgb 0.1862731835 0.0856347366 0.1310611506); +} diff --git a/spec/core_functions/color/to_space/lch/display_p3.hrx b/spec/core_functions/color/to_space/lch/display_p3.hrx new file mode 100644 index 0000000000..c34a776935 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/display_p3.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.4663266093 0.4663266093 0.4663266093); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.1810277824 0.0722540734 0.0569980019); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), display-p3)} + +<===> float/output.css +a { + b: color(display-p3 0.1852138261 0.0708949536 0.054721162); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 0.5150813189 -0.3405175977 -0.0725015019); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 20032.6181692902 -12940.6885284751 3928.8140693077); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.1810277824 0.0722540734 0.0569980019 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.1810277824 0.0722540734 0.0569980019 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), display-p3)} + +<===> missing/lightness/output.css +a { + b: color(display-p3 0.1144797929 -0.0473082464 -0.0747498159); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), display-p3)} + +<===> missing/chroma/output.css +a { + b: color(display-p3 0.1077034111 0.1077034111 0.1077034111); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), display-p3)} + +<===> missing/hue/output.css +a { + b: color(display-p3 0.1823778479 0.0651398083 0.1096920557); +} diff --git a/spec/core_functions/color/to_space/lch/hsl.hrx b/spec/core_functions/color/to_space/lch/hsl.hrx new file mode 100644 index 0000000000..314b60c6a9 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/hsl.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 46.6326609284%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), hsl)} + +<===> middle/output.css +a { + b: hsl(5.5048306165, 59.0012292082%, 12.4106897496%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), hsl)} + +<===> float/output.css +a { + b: hsl(5.5490985392, 61.5887632777%, 12.5078193109%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(340.1543058221, 427.9584468502%, 11.074503568%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(149.4283545837, 420.5938588221%, 429851.5077692641%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(5.5048306165, 59.0012292082%, 12.4106897496%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(5.5048306165, 59.0012292082%, 12.4106897496%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), hsl)} + +<===> missing/lightness/output.css +a { + b: hsl(6.9848409854, 394.5339053958%, 0%); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), hsl)} + +<===> missing/chroma/output.css +a { + b: hsl(0, 0%, 10.7703411095%); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), hsl)} + +<===> missing/hue/output.css +a { + b: hsl(0, 56.1707811732%, 12.7694440441%); +} diff --git a/spec/core_functions/color/to_space/lch/hwb.hrx b/spec/core_functions/color/to_space/lch/hwb.hrx new file mode 100644 index 0000000000..6b5b315a8e --- /dev/null +++ b/spec/core_functions/color/to_space/lch/hwb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), hwb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), hwb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), hwb)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 46.6326609284%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), hwb)} + +<===> middle/output.css +a { + b: hsl(5.5048306165, 59.0012292082%, 12.4106897496%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), hwb)} + +<===> float/output.css +a { + b: hsl(5.5490985392, 61.5887632777%, 12.5078193109%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), hwb)} + +<===> out_of_range/near/output.css +a { + b: hsl(340.1543058221, 427.9584468502%, 11.074503568%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), hwb)} + +<===> out_of_range/far/output.css +a { + b: hsl(149.4283545837, 420.5938588221%, 429851.5077692638%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), hwb)} + +<===> alpha/partial/output.css +a { + b: hsla(5.5048306165, 59.0012292082%, 12.4106897496%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), hwb)} + +<===> alpha/transparent/output.css +a { + b: hsla(5.5048306165, 59.0012292082%, 12.4106897496%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), hwb)} + +<===> missing/lightness/output.css +a { + b: hsl(6.9848409854, 394.5339053958%, 2.7008748146%); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), hwb)} + +<===> missing/chroma/output.css +a { + b: hsl(0, 0%, 10.7703411095%); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), hwb)} + +<===> missing/hue/output.css +a { + b: hsl(0, 56.1707811732%, 12.7694440441%); +} diff --git a/spec/core_functions/color/to_space/lch/lab.hrx b/spec/core_functions/color/to_space/lch/lab.hrx new file mode 100644 index 0000000000..2512251ec7 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/lab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), lab)} + +<===> black/output.css +a { + b: lab(0% none none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), lab)} + +<===> gray/output.css +a { + b: lab(50% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), lab)} + +<===> middle/output.css +a { + b: lab(10% 17.3205080757 10); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), lab)} + +<===> float/output.css +a { + b: lab(10.123456789% 18.1404203948 10.5549411083); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), lab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lab, color(xyz 0.0846054544 -0.0138950708 -0.0108304931) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), lab)} + +<===> out_of_range/far/output.css +a { + b: lab(10% 999999 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(10% 17.3205080757 10 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(10% 17.3205080757 10 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), lab)} + +<===> missing/lightness/output.css +a { + b: lab(none none none); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), lab)} + +<===> missing/chroma/output.css +a { + b: lab(10% 0 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), lab)} + +<===> missing/hue/output.css +a { + b: lab(10% 20 0); +} diff --git a/spec/core_functions/color/to_space/lch/lch.hrx b/spec/core_functions/color/to_space/lch/lch.hrx new file mode 100644 index 0000000000..1407343af1 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/lch.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), lch)} + +<===> in_range/output.css +a { + b: lch(10% 20 30deg); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), lch)} + +<===> out_of_range/output.css +a { + b: color-mix(in lch, color(xyz 0.0846054544 -0.0138950708 -0.0108304931) 100%, black); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), lch)} + +<===> missing/lightness/output.css +a { + b: lch(none 20 30deg); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), lch)} + +<===> missing/chroma/output.css +a { + b: lch(10% none 30deg); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), lch)} + +<===> missing/hue/output.css +a { + b: lch(10% 20 none); +} diff --git a/spec/core_functions/color/to_space/lch/oklab.hrx b/spec/core_functions/color/to_space/lch/oklab.hrx new file mode 100644 index 0000000000..85b110a17c --- /dev/null +++ b/spec/core_functions/color/to_space/lch/oklab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), oklab)} + +<===> gray/output.css +a { + b: oklab(56.8965513528% 0 0.0000000212); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), oklab)} + +<===> middle/output.css +a { + b: oklab(22.8705495852% 0.0494077592 0.0263450873); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), oklab)} + +<===> float/output.css +a { + b: oklab(22.9987502615% 0.0516259003 0.0278217212); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), oklab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklab, color(xyz 0.0846054544 -0.0138950708 -0.0108304931) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz 7373327412.161988 -218927236.26953584 95026466.80033648) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(22.8705495852% 0.0494077592 0.0263450873 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(22.8705495852% 0.0494077592 0.0263450873 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), oklab)} + +<===> missing/lightness/output.css +a { + b: oklab(none 0.4083922235 0.0807817391); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), oklab)} + +<===> missing/chroma/output.css +a { + b: oklab(22.4137929572% 0 0.0000000084); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), oklab)} + +<===> missing/hue/output.css +a { + b: oklab(23.0834632697% 0.0614345595 -0.0007016084); +} diff --git a/spec/core_functions/color/to_space/lch/oklch.hrx b/spec/core_functions/color/to_space/lch/oklch.hrx new file mode 100644 index 0000000000..b2075e3290 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/oklch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), oklch)} + +<===> gray/output.css +a { + b: oklch(56.8965513528% 0.0000000212 89.8755629589deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), oklch)} + +<===> middle/output.css +a { + b: oklch(22.8705495852% 0.05599277 28.0673245733deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), oklch)} + +<===> float/output.css +a { + b: oklch(22.9987502615% 0.0586453899 28.320677744deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), oklch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklch, color(xyz 0.0846054544 -0.0138950708 -0.0108304931) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz 7373327412.161987 -218927236.2695358 95026466.80033481) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(22.8705495852% 0.05599277 28.0673245733deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(22.8705495852% 0.05599277 28.0673245733deg / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), oklch)} + +<===> missing/lightness/output.css +a { + b: oklch(none 0.4163050536 11.1889160032deg); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), oklch)} + +<===> missing/chroma/output.css +a { + b: oklch(22.4137929572% none 89.8755627743deg); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), oklch)} + +<===> missing/hue/output.css +a { + b: oklch(23.0834632697% 0.0614385657 none); +} diff --git a/spec/core_functions/color/to_space/lch/prophoto_rgb.hrx b/spec/core_functions/color/to_space/lch/prophoto_rgb.hrx new file mode 100644 index 0000000000..b16ee6343d --- /dev/null +++ b/spec/core_functions/color/to_space/lch/prophoto_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.3906698633 0.3906698633 0.3906698633); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.1119358598 0.0682122171 0.0505966427); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), prophoto-rgb)} + +<===> float/output.css +a { + b: color(prophoto-rgb 0.1140986722 0.0679789036 0.0492544884); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb 0.3120531174 -0.2195824001 -0.0819271128); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb 367010.4615537181 -222031.7168269293 0.0827038254); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.1119358598 0.0682122171 0.0505966427 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.1119358598 0.0682122171 0.0505966427 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), prophoto-rgb)} + +<===> missing/lightness/output.css +a { + b: color(prophoto-rgb 0.0585320378 -0.0354038244 -0.0605339143); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), prophoto-rgb)} + +<===> missing/chroma/output.css +a { + b: color(prophoto-rgb 0.0827038254 0.0827038254 0.0827038254); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), prophoto-rgb)} + +<===> missing/hue/output.css +a { + b: color(prophoto-rgb 0.1155645311 0.0659678734 0.0827038254); +} diff --git a/spec/core_functions/color/to_space/lch/rec2020.hrx b/spec/core_functions/color/to_space/lch/rec2020.hrx new file mode 100644 index 0000000000..74e0b2d835 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/rec2020.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.4141328903 0.4141328903 0.4141328903); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.0987940535 0.0323770888 0.0206839256); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), rec2020)} + +<===> float/output.css +a { + b: color(rec2020 0.1021786723 0.0319354657 0.0196866185); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 0.3729067583 -0.2515671342 -0.0365252061); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 38725.5976285713 -26052.9381914356 6353.219962186); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.0987940535 0.0323770888 0.0206839256 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.0987940535 0.0323770888 0.0206839256 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), rec2020)} + +<===> missing/lightness/output.css +a { + b: color(rec2020 0.0374222506 -0.0134835285 -0.0293129957); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), rec2020)} + +<===> missing/chroma/output.css +a { + b: color(rec2020 0.0506708967 0.0506708967 0.0506708967); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), rec2020)} + +<===> missing/hue/output.css +a { + b: color(rec2020 0.1006265985 0.0294359094 0.0515937784); +} diff --git a/spec/core_functions/color/to_space/lch/rgb.hrx b/spec/core_functions/color/to_space/lch/rgb.hrx new file mode 100644 index 0000000000..5cc033f02c --- /dev/null +++ b/spec/core_functions/color/to_space/lch/rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), rgb)} + +<===> gray/output.css +a { + b: rgb(118.9132853673, 118.9132853673, 118.9132853673); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), rgb)} + +<===> middle/output.css +a { + b: rgb(50.3195306005, 16.4012435608, 12.9749871225); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), rgb)} + +<===> float/output.css +a { + b: rgb(51.5386378704, 15.8847345936, 12.2512406149); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(340.1543058221, 427.9584468502%, 11.074503568%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(149.4283545837, 420.5938588221%, 429851.5077692641%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: rgba(50.3195306005, 16.4012435608, 12.9749871225, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: rgba(50.3195306005, 16.4012435608, 12.9749871225, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), rgb)} + +<===> missing/lightness/output.css +a { + b: hsl(6.9848409854, 394.5339053958%, 2.7008748146%); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), rgb)} + +<===> missing/chroma/output.css +a { + b: rgb(27.4643698292, 27.4643698292, 27.4643698292); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), rgb)} + +<===> missing/hue/output.css +a { + b: rgb(50.8524583137, 14.2717063113, 28.2183712056); +} diff --git a/spec/core_functions/color/to_space/lch/srgb.hrx b/spec/core_functions/color/to_space/lch/srgb.hrx new file mode 100644 index 0000000000..c4509407bc --- /dev/null +++ b/spec/core_functions/color/to_space/lch/srgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.4663266093 0.4663266093 0.4663266093); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.1973314926 0.0643186022 0.0508823024); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), srgb)} + +<===> float/output.css +a { + b: color(srgb 0.2021123054 0.0622930768 0.0480440808); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb 0.5846877703 -0.363197699 -0.0496736133); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb 22373.5995764218 -13776.5694210365 4642.9330511282); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.1973314926 0.0643186022 0.0508823024 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.1973314926 0.0643186022 0.0508823024 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), srgb)} + +<===> missing/lightness/output.css +a { + b: color(srgb 0.133567417 -0.0547400755 -0.0795499207); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), srgb)} + +<===> missing/chroma/output.css +a { + b: color(srgb 0.1077034111 0.1077034111 0.1077034111); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), srgb)} + +<===> missing/hue/output.css +a { + b: color(srgb 0.1994214052 0.0559674757 0.1106602792); +} diff --git a/spec/core_functions/color/to_space/lch/srgb_linear.hrx b/spec/core_functions/color/to_space/lch/srgb_linear.hrx new file mode 100644 index 0000000000..23c7ac3892 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/srgb_linear.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.1841865185 0.1841865185 0.1841865185); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.0322794103 0.0053492596 0.0040157827); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), srgb-linear)} + +<===> float/output.css +a { + b: color(srgb-linear 0.033766727 0.0051339047 0.0037622653); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear 0.300965983 -0.1085200613 -0.0039066402); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear 24185926345.93111 -7553302222.606848 555275171.9499303); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.0322794103 0.0053492596 0.0040157827 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.0322794103 0.0053492596 0.0040157827 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), srgb-linear)} + +<===> missing/lightness/output.css +a { + b: color(srgb-linear 0.016044052 -0.0043759334 -0.0071369782); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), srgb-linear)} + +<===> missing/chroma/output.css +a { + b: color(srgb-linear 0.0112601993 0.0112601993 0.0112601993); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), srgb-linear)} + +<===> missing/hue/output.css +a { + b: color(srgb-linear 0.0329247775 0.004494318 0.0117575878); +} diff --git a/spec/core_functions/color/to_space/lch/xyz.hrx b/spec/core_functions/color/to_space/lch/xyz.hrx new file mode 100644 index 0000000000..64730b4993 --- /dev/null +++ b/spec/core_functions/color/to_space/lch/xyz.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.1750611682 0.1841865185 0.2005897556); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.0159493149 0.0109793933 0.0050787218); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), xyz)} + +<===> float/output.css +a { + b: color(xyz 0.0164399081 0.0111233378 0.0048408272); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.0846054544 -0.0138950708 -0.0108304931); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz 7373327412.161998 -218927236.2695362 95026466.80033655); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0159493149 0.0109793933 0.0050787218 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0159493149 0.0109793933 0.0050787218 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), xyz)} + +<===> missing/lightness/output.css +a { + b: color(xyz 0.0037635667 -0.0002331742 -0.006995371); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), xyz)} + +<===> missing/chroma/output.css +a { + b: color(xyz 0.0107023231 0.0112601993 0.0122630073); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), xyz)} + +<===> missing/hue/output.css +a { + b: color(xyz 0.0173069918 0.0110640949 0.0123481274); +} diff --git a/spec/core_functions/color/to_space/lch/xyz_d50.hrx b/spec/core_functions/color/to_space/lch/xyz_d50.hrx new file mode 100644 index 0000000000..43223cc48f --- /dev/null +++ b/spec/core_functions/color/to_space/lch/xyz_d50.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(lch(0% 0 0deg), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(lch(100% 0 0deg), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(lch(50% 0 0deg), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.1776102635 0.1841865185 0.1519731441); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.0167107924 0.0112601993 0.003836437); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10.123456789% 20.987654321 30.192837465deg), xyz-d50)} + +<===> float/output.css +a { + b: color(xyz-d50 0.0172401432 0.0114213638 0.0036552028); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(lch(0% 200 0deg), $lightness: -10%), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 0.0888853348 -0.0110705646 -0.0091343738); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 999999 0deg), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 7716936176.70525 0.0112601993 0.0092908422); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0167107924 0.0112601993 0.003836437 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 30deg / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0167107924 0.0112601993 0.003836437 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(lch(none 20 30deg), xyz-d50)} + +<===> missing/lightness/output.css +a { + b: color(xyz-d50 0.0042897166 0 -0.0052979368); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% none 30deg), xyz-d50)} + +<===> missing/chroma/output.css +a { + b: color(xyz-d50 0.0108581615 0.0112601993 0.0092908422); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(lch(10% 20 none), xyz-d50)} + +<===> missing/hue/output.css +a { + b: color(xyz-d50 0.0177706181 0.0112601993 0.0092908422); +} diff --git a/spec/core_functions/color/to_space/oklab/a98_rgb.hrx b/spec/core_functions/color/to_space/oklab/a98_rgb.hrx new file mode 100644 index 0000000000..04be5ea8c5 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 0.9999999799 1.000000009 1.0000001143); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.3884711027 0.388471114 0.3884711549); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.4723956119 -0.3075477289 0.9952387413); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -1.6915317691 2.7130844081 -5.3317336738); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -66665446.96678426 49015676.54589439 12422985.883539313); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.2172671914 -0.1122840454 -0.2493572785 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.2172671914 -0.1122840454 -0.2493572785 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), a98-rgb)} + +<===> missing/lightness/output.css +a { + b: color(a98-rgb 0.0734724303 0.1640446338 -0.3638546832); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), a98-rgb)} + +<===> missing/a/output.css +a { + b: color(a98-rgb 0.1171245434 0.0794773258 -0.2290203701); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), a98-rgb)} + +<===> missing/b/output.css +a { + b: color(a98-rgb 0.1433510554 -0.0992363406 0.0248601585); +} diff --git a/spec/core_functions/color/to_space/oklab/display_p3.hrx b/spec/core_functions/color/to_space/oklab/display_p3.hrx new file mode 100644 index 0000000000..8a5b5a4f20 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 0.9999999764 1.0000000074 1.0000001047); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.3885728491 0.3885728621 0.3885729031); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.5192153014 -0.2770640957 0.9741963252); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -2.0082801891 2.5077633347 -4.7222178033); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -16964712.17081906 11051276.299069608 2566313.802188239); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.2245541345 -0.0715469676 -0.2325234092 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.2245541345 -0.0715469676 -0.2325234092 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), display-p3)} + +<===> missing/lightness/output.css +a { + b: color(display-p3 0.011277471 0.1430562743 -0.3528893187); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), display-p3)} + +<===> missing/a/output.css +a { + b: color(display-p3 0.0980260328 0.0512840259 -0.2115516265); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), display-p3)} + +<===> missing/b/output.css +a { + b: color(display-p3 0.1380887377 -0.0636630597 0.0058108376); +} diff --git a/spec/core_functions/color/to_space/oklab/hsl.hrx b/spec/core_functions/color/to_space/oklab/hsl.hrx new file mode 100644 index 0000000000..0634815f77 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), hsl)} + +<===> white/output.css +a { + b: hsl(43.8135971986, 172.5242105081%, 100.0000042145%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), hsl)} + +<===> gray/output.css +a { + b: hsl(223.8135972091, 0.0000078676%, 38.8572876766%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), hsl)} + +<===> middle/output.css +a { + b: hsl(280.3037191595, 185.1123260276%, 35.6118905417%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(280.1786410944, 318.2272126608%, -118.134272113%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(340.1123890362, 426.4426890198%, -360094010.73043364%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(19.0047457513, 6337.7067481883%, 0.3924710109%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(19.0047457513, 6337.7067481883%, 0.3924710109%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), hsl)} + +<===> missing/lightness/output.css +a { + b: hsl(261.4365788529, 230.0242883505%, 0%); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), hsl)} + +<===> missing/a/output.css +a { + b: hsl(229.5442945473, 280.5312633728%, -5.8764819359%); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), hsl)} + +<===> missing/b/output.css +a { + b: hsl(339.4567046558, 263.6331199652%, 4.40110336%); +} diff --git a/spec/core_functions/color/to_space/oklab/hwb.hrx b/spec/core_functions/color/to_space/oklab/hwb.hrx new file mode 100644 index 0000000000..67814d17e0 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/hwb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), hwb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), hwb)} + +<===> white/output.css +a { + b: hsl(43.8135971652, 172.5242119439%, 100.0000042145%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), hwb)} + +<===> gray/output.css +a { + b: hsl(223.8135972091, 0.0000078676%, 38.8572876766%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), hwb)} + +<===> middle/output.css +a { + b: hsl(280.3037191595, 185.1123260276%, 35.6118905417%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), hwb)} + +<===> out_of_range/near/output.css +a { + b: hsl(280.1786410944, 318.2272126608%, -118.134272113%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), hwb)} + +<===> out_of_range/far/output.css +a { + b: hsl(340.1123890362, 426.4426890198%, -360094010.73043364%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), hwb)} + +<===> alpha/partial/output.css +a { + b: hsla(19.0047457513, 6337.7067481883%, 0.3924710109%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), hwb)} + +<===> alpha/transparent/output.css +a { + b: hsla(19.0047457513, 6337.7067481883%, 0.3924710109%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), hwb)} + +<===> missing/lightness/output.css +a { + b: hsl(261.4365788529, 230.0242883505%, -11.2533870657%); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), hwb)} + +<===> missing/a/output.css +a { + b: hsl(229.5442945473, 280.5312633728%, -5.8764819359%); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), hwb)} + +<===> missing/b/output.css +a { + b: hsl(339.4567046558, 263.6331199652%, 4.40110336%); +} diff --git a/spec/core_functions/color/to_space/oklab/lab.hrx b/spec/core_functions/color/to_space/oklab/lab.hrx new file mode 100644 index 0000000000..8c4ba59ba9 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), lab)} + +<===> white/output.css +a { + b: color-mix(in lab, color(xyz 0.9504559526 1.0000000182 1.0890580001) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), lab)} + +<===> gray/output.css +a { + b: lab(42.0000002803% 0.0000000582 -0.0000070926); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), lab)} + +<===> middle/output.css +a { + b: lab(33.0422497851% 107.2195839075 -107.9836652126); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), lab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lab, color(xyz -7.6342507319 1.7017043263 -38.7847424885) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -76837326254677664 3783159310641774 5396110649242741) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(2.4858192097% 37.8559749186 70.2237149791 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(2.4858192097% 37.8559749186 70.2237149791 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), lab)} + +<===> missing/lightness/output.css +a { + b: lab(none -64.726469561 159.0711423642); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), lab)} + +<===> missing/a/output.css +a { + b: lab(2.4372581534% none 58.4055225293); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), lab)} + +<===> missing/b/output.css +a { + b: lab(0.4263319128% 27.5478510774 none); +} diff --git a/spec/core_functions/color/to_space/oklab/lch.hrx b/spec/core_functions/color/to_space/oklab/lch.hrx new file mode 100644 index 0000000000..fec8ca90f6 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), lch)} + +<===> white/output.css +a { + b: color-mix(in lch, color(xyz 0.9504559526 1.0000000182 1.0890580001) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), lch)} + +<===> gray/output.css +a { + b: lch(42.0000002803% 0.0000070929 270.4699000403deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), lch)} + +<===> middle/output.css +a { + b: lch(33.0422497851% 152.1726359305 314.7965716122deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), lch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lch, color(xyz -7.6342507319 1.7017043263 -38.7847424885) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -76842638588973744 3781392309267311 5284390240038480) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(2.4858192097% 79.7774716477 61.6719233557deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(2.4858192097% 79.7774716477 61.6719233557deg / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), lch)} + +<===> missing/lightness/output.css +a { + b: lch(none 171.7356811932 112.1415379531deg); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), lch)} + +<===> missing/a/output.css +a { + b: lch(2.4372581534% 59.0755529992 98.6375851746deg); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), lch)} + +<===> missing/b/output.css +a { + b: lch(0.4263319128% 27.5527624534 1.0818401525deg); +} diff --git a/spec/core_functions/color/to_space/oklab/oklab.hrx b/spec/core_functions/color/to_space/oklab/oklab.hrx new file mode 100644 index 0000000000..a12ef7de1f --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/oklab.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), oklab)} + +<===> in_range/output.css +a { + b: oklab(50% 0.2 -0.3); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), oklab)} + +<===> out_of_range/output.css +a { + b: color-mix(in oklab, color(xyz -7.6342507319 1.7017043263 -38.7847424885) 100%, black); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), oklab)} + +<===> missing/lightness/output.css +a { + b: oklab(none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), oklab)} + +<===> missing/a/output.css +a { + b: oklab(10% none 0.3); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), oklab)} + +<===> missing/b/output.css +a { + b: oklab(10% 0.2 none); +} diff --git a/spec/core_functions/color/to_space/oklab/oklch.hrx b/spec/core_functions/color/to_space/oklab/oklch.hrx new file mode 100644 index 0000000000..6216bcfe86 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), oklch)} + +<===> white/output.css +a { + b: oklch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), oklch)} + +<===> gray/output.css +a { + b: oklch(50% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), oklch)} + +<===> middle/output.css +a { + b: oklch(50% 0.3605551275 303.690067526deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), oklch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklch, color(xyz -7.6342507319 1.7017043263 -38.7847424885) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: oklch(50% 999999 180deg); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(10% 0.3605551275 56.309932474deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(10% 0.3605551275 56.309932474deg / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), oklch)} + +<===> missing/lightness/output.css +a { + b: oklch(none 0.3605551275 56.309932474deg); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), oklch)} + +<===> missing/a/output.css +a { + b: oklch(10% 0.3 90deg); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), oklch)} + +<===> missing/b/output.css +a { + b: oklch(10% 0.2 0deg); +} diff --git a/spec/core_functions/color/to_space/oklab/prophoto_rgb.hrx b/spec/core_functions/color/to_space/oklab/prophoto_rgb.hrx new file mode 100644 index 0000000000..c7ba72553c --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1.0000000036 1.0000000099 1.0000001263); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.3149802636 0.3149802656 0.3149803022); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.4918881954 -0.0624904068 0.9386035712); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -2.9829710472 2.6753284297 -7.2338243089); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -2922133015.648196 1810415223.5562131 574653584.8087448); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.1071252394 -0.0424411714 -0.1726130102 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.1071252394 -0.0424411714 -0.1726130102 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), prophoto-rgb)} + +<===> missing/lightness/output.css +a { + b: color(prophoto-rgb -0.0831372042 0.0891975511 -0.2723906896); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), prophoto-rgb)} + +<===> missing/a/output.css +a { + b: color(prophoto-rgb 0.0211561039 0.0415370447 -0.1548071681); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), prophoto-rgb)} + +<===> missing/b/output.css +a { + b: color(prophoto-rgb 0.0759873356 -0.0414646645 0.0022071932); +} diff --git a/spec/core_functions/color/to_space/oklab/rec2020.hrx b/spec/core_functions/color/to_space/oklab/rec2020.hrx new file mode 100644 index 0000000000..70e0073a96 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 0.9999999872 1.0000000081 1.0000001161); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.3319485728 0.3319485809 0.3319486233); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.4424432787 -0.1481489957 0.9623483669); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -1.92504049 2.5779941201 -5.465676751); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -56131669.11203061 38257478.199239716 10955271.878602052); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.1199235027 -0.0200899821 -0.1691453887 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.1199235027 -0.0200899821 -0.1691453887 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), rec2020)} + +<===> missing/lightness/output.css +a { + b: color(rec2020 -0.002787099 0.0709375609 -0.2911317053); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), rec2020)} + +<===> missing/a/output.css +a { + b: color(rec2020 0.028710049 0.0171073657 -0.1474743881); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), rec2020)} + +<===> missing/b/output.css +a { + b: color(rec2020 0.052988574 -0.0188512434 0.0014800891); +} diff --git a/spec/core_functions/color/to_space/oklab/rgb.hrx b/spec/core_functions/color/to_space/oklab/rgb.hrx new file mode 100644 index 0000000000..099da0dc6b --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), rgb)} + +<===> white/output.css +a { + b: hsl(43.8135971986, 172.5242105081%, 100.0000042145%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), rgb)} + +<===> gray/output.css +a { + b: rgb(99.0860757797, 99.0860799859, 99.0860913711); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), rgb)} + +<===> middle/output.css +a { + b: hsl(280.3037191595, 185.1123260276%, 35.6118905417%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(280.1786410944, 318.2272126608%, -118.134272113%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(340.1123890362, 426.4426890198%, -360094010.73043364%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(19.0047457513, 6337.7067481883%, 0.3924710109%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(19.0047457513, 6337.7067481883%, 0.3924710109%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), rgb)} + +<===> missing/lightness/output.css +a { + b: hsl(261.4365788529, 230.0242883505%, -11.2533870657%); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), rgb)} + +<===> missing/a/output.css +a { + b: hsl(229.5442945473, 280.5312633728%, -5.8764819359%); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), rgb)} + +<===> missing/b/output.css +a { + b: hsl(339.4567046558, 263.6331199652%, 4.40110336%); +} diff --git a/spec/core_functions/color/to_space/oklab/srgb.hrx b/spec/core_functions/color/to_space/oklab/srgb.hrx new file mode 100644 index 0000000000..aa6c480c74 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), srgb)} + +<===> white/output.css +a { + b: color(srgb 0.9999999694 1.0000000087 1.0000001149); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.3885728462 0.3885728627 0.3885729073); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.5825328265 -0.3031010838 1.0153388947); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -2.4568465628 2.5780112923 -4.9406967346); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -18956885.930884026 11755005.716275353 1575236.4989373833); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.2526613275 -0.0872393682 -0.2448119073 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.2526613275 -0.0872393682 -0.2448119073 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), srgb)} + +<===> missing/lightness/output.css +a { + b: color(srgb -0.0386443242 0.1463213645 -0.3713891058); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), srgb)} + +<===> missing/a/output.css +a { + b: color(srgb 0.1060888708 0.0486334832 -0.2236185095); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), srgb)} + +<===> missing/b/output.css +a { + b: color(srgb 0.1600386946 -0.0720166274 0.0074363895); +} diff --git a/spec/core_functions/color/to_space/oklab/srgb_linear.hrx b/spec/core_functions/color/to_space/oklab/srgb_linear.hrx new file mode 100644 index 0000000000..634cdfe901 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 0.9999999305 1.0000000197 1.0000002613); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.1249999913 0.1250000025 0.1250000327); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.2985384134 -0.074783816 1.0352499891); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -8.0200588156 8.9800887523 -41.7661704476); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -257534189123413888 81795409108779168 657391329523393.8); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.0519480297 -0.0081553321 -0.0488237803 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.0519480297 -0.0081553321 -0.0488237803 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), srgb-linear)} + +<===> missing/lightness/output.css +a { + b: color(srgb-linear -0.0029910468 0.0187728311 -0.1136916938); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), srgb-linear)} + +<===> missing/a/output.css +a { + b: color(srgb-linear 0.01099389 0.0038141198 -0.0409466157); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), srgb-linear)} + +<===> missing/b/output.css +a { + b: color(srgb-linear 0.0219904427 -0.0062152626 0.0005755719); +} diff --git a/spec/core_functions/color/to_space/oklab/xyz.hrx b/spec/core_functions/color/to_space/oklab/xyz.hrx new file mode 100644 index 0000000000..805aa3cb1b --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559526 1.0000000182 1.0890580001); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.1188069941 0.1250000023 0.13613225); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.2832157077 0.0847349623 0.9808955517); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz -7.6342507319 1.7017043263 -38.7847424885); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -76837326254677680 3783159310641777.5 5396110649242756); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0096949161 0.0016890376 -0.046376448 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0096949161 0.0016890376 -0.046376448 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), xyz)} + +<===> missing/lightness/output.css +a { + b: color(xyz -0.0150397763 0.004582061 -0.1058878063); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), xyz)} + +<===> missing/a/output.css +a { + b: color(xyz -0.0014924289 0.0021094378 -0.0382539306); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), xyz)} + +<===> missing/b/output.css +a { + b: color(xyz 0.0069500554 0.0002726166 0.000231366); +} diff --git a/spec/core_functions/color/to_space/oklab/xyz_d50.hrx b/spec/core_functions/color/to_space/oklab/xyz_d50.hrx new file mode 100644 index 0000000000..b2794ee8b6 --- /dev/null +++ b/spec/core_functions/color/to_space/oklab/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(0% 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(100% 0 0), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956911 1.0000000145 0.82510479); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0 0), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.1205369614 0.1250000018 0.1031380988); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% 0.2 -0.3), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.2495012093 0.0755678711 0.7361680649); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklab(0% -2 2), $lightness: -50%), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 -6.0144158738 2.1214433281 -29.0650672146); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(50% -999999 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -80704154717242816 1378317505528979.2 4824363534483794); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0125260886 0.0027519422 -0.0349334402 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0125260886 0.0027519422 -0.0349334402 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(none 0.2 0.3), xyz-d50)} + +<===> missing/lightness/output.css +a { + b: color(xyz-d50 -0.0103407367 0.0059005425 -0.0794063212); +} + +<===> +================================================================================ +<===> missing/a/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% none 0.3), xyz-d50)} + +<===> missing/a/output.css +a { + b: color(xyz-d50 0.0004044958 0.0026981824 -0.028716594); +} + +<===> +================================================================================ +<===> missing/b/input.scss +@use "sass:color"; +a {b: color.to-space(oklab(10% 0.2 none), xyz-d50)} + +<===> missing/b/output.css +a { + b: color(xyz-d50 0.007277813 0.0004719735 0.0001138228); +} diff --git a/spec/core_functions/color/to_space/oklch/a98_rgb.hrx b/spec/core_functions/color/to_space/oklch/a98_rgb.hrx new file mode 100644 index 0000000000..976047713a --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/a98_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 0.9999999799 1.000000009 1.0000001143); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.3884711027 0.388471114 0.3884711549); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.1027766441 -0.0609172248 -0.0321025971); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), a98-rgb)} + +<===> float/output.css +a { + b: color(a98-rgb 0.1569345546 -0.1088588794 -0.038585035); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb 0.3172861934 -0.2637782471 -0.1086210387); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb 66665577.100123584 -49015761.348732136 -12422991.362568038); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.1027766441 -0.0609172248 -0.0321025971 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.1027766441 -0.0609172248 -0.0321025971 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), a98-rgb)} + +<===> missing/lightness/output.css +a { + b: color(a98-rgb 0.0213511879 0.0047462167 -0.0347458469); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), a98-rgb)} + +<===> missing/chroma/output.css +a { + b: color(a98-rgb 0.0432393553 0.0432393565 0.0432393611); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), a98-rgb)} + +<===> missing/hue/output.css +a { + b: color(a98-rgb 0.0964961637 -0.0571048143 0.0359545033); +} diff --git a/spec/core_functions/color/to_space/oklch/display_p3.hrx b/spec/core_functions/color/to_space/oklch/display_p3.hrx new file mode 100644 index 0000000000..0753730ca9 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/display_p3.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 0.9999999764 1.0000000074 1.0000001047); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.3885728491 0.3885728621 0.3885729031); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.0863974377 -0.022155665 -0.0050290551); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), display-p3)} + +<===> float/output.css +a { + b: color(display-p3 0.1548116084 -0.0741945938 -0.0069035722); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 0.3493925785 -0.240514802 -0.0760588329); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 16964742.301441267 -11051293.581589133 -2566311.5001529297); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.0863974377 -0.022155665 -0.0050290551 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.0863974377 -0.022155665 -0.0050290551 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), display-p3)} + +<===> missing/lightness/output.css +a { + b: color(display-p3 0.0031329176 0.0002226378 -0.0075165654); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), display-p3)} + +<===> missing/chroma/output.css +a { + b: color(display-p3 0.0129199993 0.0129200002 0.0129200031); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), display-p3)} + +<===> missing/hue/output.css +a { + b: color(display-p3 0.0784514548 -0.0192081243 0.0093493065); +} diff --git a/spec/core_functions/color/to_space/oklch/hsl.hrx b/spec/core_functions/color/to_space/oklch/hsl.hrx new file mode 100644 index 0000000000..bc3ed7eab5 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/hsl.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), hsl)} + +<===> white/output.css +a { + b: hsl(43.8135971986, 172.5242105081%, 100.0000042145%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), hsl)} + +<===> gray/output.css +a { + b: hsl(223.8135972091, 0.0000078676%, 38.8572876766%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), hsl)} + +<===> middle/output.css +a { + b: hsl(349.9222383971, 174.3087628098%, 3.6948783654%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), hsl)} + +<===> float/output.css +a { + b: hsl(342.3640346721, 274.4922188663%, 4.7714615434%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(342.6995890373, 454.6290714992%, 7.2218303523%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(160.1123681644, 426.4426548179%, 360094749.97600085%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(349.9222383971, 174.3087628098%, 3.6948783654%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(349.9222383971, 174.3087628098%, 3.6948783654%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), hsl)} + +<===> missing/lightness/output.css +a { + b: hsl(221.7487183642, 266.6061391496%, 0%); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), hsl)} + +<===> missing/chroma/output.css +a { + b: hsl(223.8135982915, 0%, 1.2920001239%); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), hsl)} + +<===> missing/hue/output.css +a { + b: hsl(0, 169.3005035983%, 3.4369836375%); +} diff --git a/spec/core_functions/color/to_space/oklch/hwb.hrx b/spec/core_functions/color/to_space/oklch/hwb.hrx new file mode 100644 index 0000000000..3e6e8696f9 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/hwb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), hwb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), hwb)} + +<===> white/output.css +a { + b: hsl(43.8135971652, 172.5242119439%, 100.0000042145%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), hwb)} + +<===> gray/output.css +a { + b: hsl(223.8135972091, 0.0000078676%, 38.8572876766%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), hwb)} + +<===> middle/output.css +a { + b: hsl(349.9222383971, 174.3087628098%, 3.6948783654%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), hwb)} + +<===> float/output.css +a { + b: hsl(342.3640346721, 274.4922188663%, 4.7714615434%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), hwb)} + +<===> out_of_range/near/output.css +a { + b: hsl(342.6995890373, 454.6290714992%, 7.2218303523%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), hwb)} + +<===> out_of_range/far/output.css +a { + b: hsl(160.1123681644, 426.4426548179%, 360094749.9760007%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), hwb)} + +<===> alpha/partial/output.css +a { + b: hsla(349.9222383971, 174.3087628098%, 3.6948783654%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), hwb)} + +<===> alpha/transparent/output.css +a { + b: hsla(349.9222383971, 174.3087628098%, 3.6948783654%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), hwb)} + +<===> missing/lightness/output.css +a { + b: hsl(221.7487183642, 266.6061391496%, -0.2273359503%); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), hwb)} + +<===> missing/chroma/output.css +a { + b: hsl(223.813598298, 0.0000165409%, 1.2920001239%); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), hwb)} + +<===> missing/hue/output.css +a { + b: hsl(0, 169.3005035983%, 3.4369836375%); +} diff --git a/spec/core_functions/color/to_space/oklch/lab.hrx b/spec/core_functions/color/to_space/oklch/lab.hrx new file mode 100644 index 0000000000..d648c62379 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/lab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), lab)} + +<===> white/output.css +a { + b: color-mix(in lab, color(xyz 0.9504559526 1.0000000182 1.0890580001) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), lab)} + +<===> gray/output.css +a { + b: lab(42.0000002803% 0.0000000582 -0.0000070926); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), lab)} + +<===> middle/output.css +a { + b: lab(0.6560445641% 11.6264793014 1.8588166268); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), lab)} + +<===> float/output.css +a { + b: lab(0.4361236096% 33.2605943231 2.095776706); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), lab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lab, color(xyz 0.0348582183 -0.010229465 -0.0091226442) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz 76838084844227696 -3783161942592645 -5396112427214629) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(0.6560445641% 11.6264793014 1.8588166268 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(0.6560445641% 11.6264793014 1.8588166268 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), lab)} + +<===> missing/lightness/output.css +a { + b: lab(none 0.0322037834 0.9096922188); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), lab)} + +<===> missing/chroma/output.css +a { + b: lab(0.9032963094% 0.0000000027 -0.0000003314); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), lab)} + +<===> missing/hue/output.css +a { + b: lab(0.6385915087% 10.5093876004 0.1611873791); +} diff --git a/spec/core_functions/color/to_space/oklch/lch.hrx b/spec/core_functions/color/to_space/oklch/lch.hrx new file mode 100644 index 0000000000..78d3acdff1 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/lch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), lch)} + +<===> white/output.css +a { + b: color-mix(in lch, color(xyz 0.9504559526 1.0000000182 1.0890580001) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), lch)} + +<===> gray/output.css +a { + b: lch(42.0000002803% 0.0000070929 270.4699000403deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), lch)} + +<===> middle/output.css +a { + b: lch(0.6560445641% 11.7741335222 9.0834533485deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), lch)} + +<===> float/output.css +a { + b: lch(0.4361236096% 33.3265571988 3.6054863359deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), lch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lch, color(xyz 0.0348582183 -0.010229465 -0.0091226442) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz 76837027122572336 -3783130536950956 -5396126058991186) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(0.6560445641% 11.7741335222 9.0834533485deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(0.6560445641% 11.7741335222 9.0834533485deg / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), lch)} + +<===> missing/lightness/output.css +a { + b: lch(none 0.9102620593 87.9725333167deg); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), lch)} + +<===> missing/chroma/output.css +a { + b: lch(0.9032963094% none 270.4698988243deg); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), lch)} + +<===> missing/hue/output.css +a { + b: lch(0.6385915087% 10.5106236307 none); +} diff --git a/spec/core_functions/color/to_space/oklch/oklab.hrx b/spec/core_functions/color/to_space/oklch/oklab.hrx new file mode 100644 index 0000000000..095b09a9f4 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/oklab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), oklab)} + +<===> white/output.css +a { + b: oklab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), oklab)} + +<===> gray/output.css +a { + b: oklab(50% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), oklab)} + +<===> middle/output.css +a { + b: oklab(10% 0.0866025404 0.05); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), oklab)} + +<===> float/output.css +a { + b: oklab(10.123456789% 0.1718004519 0.099961501); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), oklab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in oklab, color(xyz 0.0348582183 -0.010229465 -0.0091226442) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), oklab)} + +<===> out_of_range/far/output.css +a { + b: oklab(10% 999998.9999999994 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(10% 0.0866025404 0.05 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(10% 0.0866025404 0.05 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), oklab)} + +<===> missing/lightness/output.css +a { + b: oklab(none 0.0866025404 0.05); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), oklab)} + +<===> missing/chroma/output.css +a { + b: oklab(10% 0 0); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), oklab)} + +<===> missing/hue/output.css +a { + b: oklab(10% 0.1 0); +} diff --git a/spec/core_functions/color/to_space/oklch/oklch.hrx b/spec/core_functions/color/to_space/oklch/oklch.hrx new file mode 100644 index 0000000000..132bdcf60f --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/oklch.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), oklch)} + +<===> in_range/output.css +a { + b: oklch(10% 0.1 30deg); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), oklch)} + +<===> out_of_range/output.css +a { + b: color-mix(in oklch, color(xyz 0.0348582183 -0.010229465 -0.0091226442) 100%, black); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), oklch)} + +<===> missing/lightness/output.css +a { + b: oklch(none 0.1 30deg); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), oklch)} + +<===> missing/chroma/output.css +a { + b: oklch(10% none 30deg); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), oklch)} + +<===> missing/hue/output.css +a { + b: oklch(10% 0.1 none); +} diff --git a/spec/core_functions/color/to_space/oklch/prophoto_rgb.hrx b/spec/core_functions/color/to_space/oklch/prophoto_rgb.hrx new file mode 100644 index 0000000000..f6aab660c5 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/prophoto_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1.0000000036 1.0000000099 1.0000001263); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.3149802636 0.3149802656 0.3149803022); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.0506096466 -0.0137951641 -0.0074760688); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), prophoto-rgb)} + +<===> float/output.css +a { + b: color(prophoto-rgb 0.0841896026 -0.0467124006 -0.013805913); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb 0.1937443943 -0.1519484627 -0.0725277832); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb 2922140081.0303516 -1810418807.7705455 -574654139.8912412); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.0506096466 -0.0137951641 -0.0074760688 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.0506096466 -0.0137951641 -0.0074760688 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), prophoto-rgb)} + +<===> missing/lightness/output.css +a { + b: color(prophoto-rgb 0.0010727238 0.000279135 -0.0088387805); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), prophoto-rgb)} + +<===> missing/chroma/output.css +a { + b: color(prophoto-rgb 0.0160000001 0.0160000003 0.0160000036); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), prophoto-rgb)} + +<===> missing/hue/output.css +a { + b: color(prophoto-rgb 0.0479066375 -0.0113980141 0.0096553537); +} diff --git a/spec/core_functions/color/to_space/oklch/rec2020.hrx b/spec/core_functions/color/to_space/oklch/rec2020.hrx new file mode 100644 index 0000000000..f92c69dccd --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/rec2020.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 0.9999999872 1.0000000081 1.0000001161); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.3319485728 0.3319485809 0.3319486233); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.0256576867 -0.0056343197 -0.0019025127); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), rec2020)} + +<===> float/output.css +a { + b: color(rec2020 0.064418765 -0.0232002216 -0.0029907849); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 0.2237639493 -0.1587187375 -0.0339392569); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 56131778.24188723 -38257541.3895273 -10955273.518136343); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.0256576867 -0.0056343197 -0.0019025127 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.0256576867 -0.0056343197 -0.0019025127 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), rec2020)} + +<===> missing/lightness/output.css +a { + b: color(rec2020 0.0007134353 0.0000902745 -0.002575042); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), rec2020)} + +<===> missing/chroma/output.css +a { + b: color(rec2020 0.0044999999 0.0045000001 0.0045000011); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), rec2020)} + +<===> missing/hue/output.css +a { + b: color(rec2020 0.0225650026 -0.0048194756 0.0030470892); +} diff --git a/spec/core_functions/color/to_space/oklch/rgb.hrx b/spec/core_functions/color/to_space/oklch/rgb.hrx new file mode 100644 index 0000000000..a232869ffc --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), rgb)} + +<===> white/output.css +a { + b: hsl(43.8135971986, 172.5242105081%, 100.0000042145%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), rgb)} + +<===> gray/output.css +a { + b: rgb(99.0860757797, 99.0860799859, 99.0860913711); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), rgb)} + +<===> middle/output.css +a { + b: hsl(349.9222383971, 174.3087628098%, 3.6948783654%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), rgb)} + +<===> float/output.css +a { + b: hsl(342.3640346721, 274.4922188663%, 4.7714615434%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(342.6995890373, 454.6290714992%, 7.2218303523%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(160.1123681644, 426.4426548179%, 360094749.97600085%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(349.9222383971, 174.3087628098%, 3.6948783654%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(349.9222383971, 174.3087628098%, 3.6948783654%, 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), rgb)} + +<===> missing/lightness/output.css +a { + b: hsl(221.7487183642, 266.6061391496%, -0.2273359503%); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), rgb)} + +<===> missing/chroma/output.css +a { + b: rgb(3.2945997709, 3.2946000649, 3.2946008608); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), rgb)} + +<===> missing/hue/output.css +a { + b: hsl(342.5627231518, 169.3005035983%, 3.4369836375%); +} diff --git a/spec/core_functions/color/to_space/oklch/srgb.hrx b/spec/core_functions/color/to_space/oklch/srgb.hrx new file mode 100644 index 0000000000..bce737c7e6 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/srgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), srgb)} + +<===> white/output.css +a { + b: color(srgb 0.9999999694 1.0000000087 1.0000001149); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.3885728462 0.3885728627 0.3885729073); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.1013537513 -0.027456184 -0.0058209203); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), srgb)} + +<===> float/output.css +a { + b: color(srgb 0.1786875221 -0.0832582912 -0.0062638365); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb 0.4005437063 -0.2561070992 -0.066768286); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb 18956919.35191059 -11755024.352390574 -1575227.1966261775); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.1013537513 -0.027456184 -0.0058209203 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.1013537513 -0.027456184 -0.0058209203 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), srgb)} + +<===> missing/lightness/output.css +a { + b: color(srgb 0.0037875565 0.0001002403 -0.0083342755); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), srgb)} + +<===> missing/chroma/output.css +a { + b: color(srgb 0.0129199991 0.0129200003 0.0129200034); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), srgb)} + +<===> missing/hue/output.css +a { + b: color(srgb 0.0925581424 -0.0238184697 0.0100030504); +} diff --git a/spec/core_functions/color/to_space/oklch/srgb_linear.hrx b/spec/core_functions/color/to_space/oklch/srgb_linear.hrx new file mode 100644 index 0000000000..c2e702874e --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/srgb_linear.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 0.9999999305 1.0000000197 1.0000002613); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.1249999913 0.1250000025 0.1250000327); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.0102342031 -0.0021250916 -0.0004505356); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), srgb-linear)} + +<===> float/output.css +a { + b: color(srgb-linear 0.0268484583 -0.00761821 -0.0004848171); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear 0.1332496936 -0.0533553421 -0.0056166345); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear 257535278804612064 -81795720332859872 -657382012471774.5); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.0102342031 -0.0021250916 -0.0004505356 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.0102342031 -0.0021250916 -0.0004505356 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), srgb-linear)} + +<===> missing/lightness/output.css +a { + b: color(srgb-linear 0.0002931545 0.0000077585 -0.0006450678); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), srgb-linear)} + +<===> missing/chroma/output.css +a { + b: color(srgb-linear 0.0009999999 0.001 0.0010000003); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), srgb-linear)} + +<===> missing/hue/output.css +a { + b: color(srgb-linear 0.0089064724 -0.0018435348 0.0007742299); +} diff --git a/spec/core_functions/color/to_space/oklch/xyz.hrx b/spec/core_functions/color/to_space/oklch/xyz.hrx new file mode 100644 index 0000000000..adc9b79216 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/xyz.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559526 1.0000000182 1.0890580001); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.1188069941 0.1250000023 0.13613225); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.0033792787 0.0006238666 -0.0004837129); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), xyz)} + +<===> float/output.css +a { + b: color(xyz 0.0082604044 0.0002257242 -0.0008498824); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.0348582183 -0.010229465 -0.0091226442); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz 76837666021869456 -3783149507010139 -5396117824941693); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0033792787 0.0006238666 -0.0004837129 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0033792787 0.0006238666 -0.0004837129 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), xyz)} + +<===> missing/lightness/output.css +a { + b: color(xyz 0.0000072462 0.0000213158 -0.000606566); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), xyz)} + +<===> missing/chroma/output.css +a { + b: color(xyz 0.000950456 0.001 0.001089058); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), xyz)} + +<===> missing/hue/output.css +a { + b: color(xyz 0.0031534617 0.0006313185 0.0006883601); +} diff --git a/spec/core_functions/color/to_space/oklch/xyz_d50.hrx b/spec/core_functions/color/to_space/oklch/xyz_d50.hrx new file mode 100644 index 0000000000..9898d9fb20 --- /dev/null +++ b/spec/core_functions/color/to_space/oklch/xyz_d50.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(0% 0 0deg), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(100% 0 0deg), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956911 1.0000000145 0.82510479); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(50% 0 0deg), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.1205369614 0.1250000018 0.1031380988); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.0035798412 0.0007262784 -0.0003855337); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10.123456789% 0.198765432 30.192837465deg), xyz-d50)} + +<===> float/output.css +a { + b: color(xyz-d50 0.0087041611 0.0004828135 -0.0007119576); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(oklch(0% 1 0deg), $lightness: -10%), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 0.0367521174 -0.0089430834 -0.007335284); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 999999 0deg), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 80704511354532880 -1378297606600871.2 -4824371922593688); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0035798412 0.0007262784 -0.0003855337 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 30deg / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0035798412 0.0007262784 -0.0003855337 / 0); +} + +<===> +================================================================================ +<===> missing/lightness/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(none 0.1 30deg), xyz-d50)} + +<===> missing/lightness/output.css +a { + b: color(xyz-d50 0.0000385276 0.000031683 -0.0004558074); +} + +<===> +================================================================================ +<===> missing/chroma/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% none 30deg), xyz-d50)} + +<===> missing/chroma/output.css +a { + b: color(xyz-d50 0.0009642957 0.001 0.0008251048); +} + +<===> +================================================================================ +<===> missing/hue/input.scss +@use "sass:color"; +a {b: color.to-space(oklch(10% 0.1 none), xyz-d50)} + +<===> missing/hue/output.css +a { + b: color(xyz-d50 0.0032845429 0.0007069569 0.0004979173); +} diff --git a/spec/core_functions/color/to_space/options.yml b/spec/core_functions/color/to_space/options.yml new file mode 100644 index 0000000000..99ecec7ed1 --- /dev/null +++ b/spec/core_functions/color/to_space/options.yml @@ -0,0 +1,3 @@ +--- +:ignore_for: +- libsass diff --git a/spec/core_functions/color/to_space/prophoto_rgb/a98_rgb.hrx b/spec/core_functions/color/to_space/prophoto_rgb/a98_rgb.hrx new file mode 100644 index 0000000000..647da9d393 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.5670420112 0.5670420112 0.5670420112); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb -0.3560951477 0.5045482124 0.8644762739); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -1.4279386159 0.6992982312 1.851989355); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -94583.3572201015 41648.2618143793 12982.0175899086); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb -0.1365499745 0.2865616306 0.3841343378 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb -0.1365499745 0.2865616306 0.3841343378 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.2938324337 0.384534187); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb -0.0732568776 none 0.3916546985); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.1371997596 0.2872404522 none); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/display_p3.hrx b/spec/core_functions/color/to_space/prophoto_rgb/display_p3.hrx new file mode 100644 index 0000000000..949122af11 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.5723067532 0.5723067532 0.5723067532); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 -0.4263141523 0.4923548598 0.8503908535); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -1.5123725709 0.6119230865 1.7528266609); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -40921.237624831 15288.5098255533 -4976.1422545962); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 -0.1681406496 0.272751421 0.3768280764 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 -0.1681406496 0.272751421 0.3768280764 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.278189942 0.3765750961); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 -0.0396944837 none 0.3821042494); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.0601855627 0.2760901066 none); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/hsl.hrx b/spec/core_functions/color/to_space/prophoto_rgb/hsl.hrx new file mode 100644 index 0000000000..f0b27df772 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(180, 50%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 57.2306753164%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(195.9034030348, 388.9813639336%, 17.9876851056%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(199.2935266227, 2154.1559841675%, 8.1167706475%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(347.1631207662, 234.6485806965%, -1340219.8783108443%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(190.4112342736, 389.9464516401%, 7.9139613859%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(190.4112342736, 389.9464516401%, 7.9139613859%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(188.6270203536, 825.3071653223%, 4.1925835467%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(241.7396943935, 128.7470611392%, 17.4883701258%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(119.2084673976, 194.643672602%, 9.5495891256%); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/hwb.hrx b/spec/core_functions/color/to_space/prophoto_rgb/hwb.hrx new file mode 100644 index 0000000000..e357ed31c3 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb 1 1 1), hwb)); + +<===> white/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(0, 0%, 57.2306753164%); + space: hwb; + channels: 0deg 57.2306753164% 42.7693246836% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: hsl(195.9034030348, 388.9813639336%, 17.9876851056%); + space: hwb; + channels: 195.9034030348deg -51.9810577583% 12.0435720304% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(199.2935266227, 2154.1559841675%, 8.1167706475%); + space: hwb; + channels: 199.2935266227deg -166.731129976% -82.9646712709% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(347.1631207662, 234.6485806965%, -1340219.878310844%); + space: hwb; + channels: 167.1631207662deg -4485026.800979206% -1804487.0443575173% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(190.4112342736, 389.9464516401%, 7.9139613859%, 0.4); + space: hwb; + channels: 190.4112342736deg -22.9462502225% 61.2258270058% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(190.4112342736, 389.9464516401%, 7.9139613859%, 0); + space: hwb; + channels: 190.4112342736deg -22.9462502225% 61.2258270058% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(188.6270203536, 825.3071653223%, 4.1925835467%); + space: hwb; + channels: 188.6270203536deg -30.409108876% 61.2057240306% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(prophoto-rgb 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(241.7396943935, 128.7470611392%, 17.4883701258%); + space: hwb; + channels: 241.7396943935deg -5.0273924523% 59.9958672962% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(119.2084673976, 194.643672602%, 9.5495891256%); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/lab.hrx b/spec/core_functions/color/to_space/prophoto_rgb/lab.hrx new file mode 100644 index 0000000000..bf8d01a067 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(60.5314588248% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(46.0098211673% -39.6566664112 -68.0244470598); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lab, color(xyz -0.4478815578 -0.0732156915 3.8173184875) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -47674467013.1876 -16929933315.113932 -247080732.77775204) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(24.9090529931% -30.9723221547 -26.5858249779 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(24.9090529931% -30.9723221547 -26.5858249779 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(23.4372923288% -57.2633255164 -29.1233433646); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: lab(4.1334625643% 41.362651194 -62.4058084759); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(24.9058511193% -38.7042406064 42.9411226195); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/lch.hrx b/spec/core_functions/color/to_space/prophoto_rgb/lch.hrx new file mode 100644 index 0000000000..856aeb782d --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(60.5314588248% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(46.0098211673% 78.7399300777 239.7588117754deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: color-mix(in lch, color(xyz -0.4478815578 -0.0732156915 3.8173184875) 100%, black); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -47674467013.187614 -16929933315.113934 -247080732.77789402) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(24.9090529931% 40.8177758998 220.6419219413deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(24.9090529931% 40.8177758998 220.6419219413deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(23.4372923288% 64.2437357096 206.9572653738deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: lch(4.1334625643% 74.8689110735 303.5364691761deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(24.9058511193% 57.8096726572 132.0293732633deg); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/oklab.hrx b/spec/core_functions/color/to_space/prophoto_rgb/oklab.hrx new file mode 100644 index 0000000000..1922a97af1 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(65.9753951081% 0.0000000001 0.0000000246); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(52.9739863521% -0.23472674 -0.1933931965); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(9.4597839538% -2.2223701334 -0.8062107579); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -47674467013.18752 -16929933315.11392 -247080732.77775192) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(34.6066204299% -0.1151566731 -0.0744029999 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(34.6066204299% -0.1151566731 -0.0744029999 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(32.493750959% -0.2028589632 -0.0824787667); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(20.6577507967% -0.042480718 -0.1739784043); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(33.9153744238% -0.1155256021 0.0932618247); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/oklch.hrx b/spec/core_functions/color/to_space/prophoto_rgb/oklch.hrx new file mode 100644 index 0000000000..7e8e1c47c8 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(65.9753951081% 0.0000000246 89.875562502deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(52.9739863521% 0.3041341331 219.4853767353deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(9.4597839538% 2.3640864612 199.9392877927deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -47674467013.18753 -16929933315.11391 -247080732.777771) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(34.6066204299% 0.1371016621 212.8665983723deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(34.6066204299% 0.1371016621 212.8665983723deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(32.493750959% 0.2189851728 202.1257651897deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(20.6577507967% 0.1790896327 256.2784427934deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(33.9153744238% 0.1484719929 141.0866609821deg); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/prophoto_rgb.hrx b/spec/core_functions/color/to_space/prophoto_rgb/prophoto_rgb.hrx new file mode 100644 index 0000000000..bbde15641a --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/prophoto_rgb.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), prophoto-rgb)} + +<===> in_range/output.css +a { + b: color(prophoto-rgb 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/output.css +a { + b: color(prophoto-rgb -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/rec2020.hrx b/spec/core_functions/color/to_space/prophoto_rgb/rec2020.hrx new file mode 100644 index 0000000000..42e3711d22 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.5277221397 0.5277221397 0.5277221397); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 -0.1605692199 0.4295080587 0.8280670897); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -1.3001703326 0.4795529651 1.8550030977); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -86467.5261196395 24057.1232097426 -7686.7078341848); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 -0.0023957954 0.2043088925 0.318295884 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 -0.0023957954 0.2043088925 0.318295884 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.2069376666 0.3181540374); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.0119013078 none 0.3219111049); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.0713341527 0.2072064033 none); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/rgb.hrx b/spec/core_functions/color/to_space/prophoto_rgb/rgb.hrx new file mode 100644 index 0000000000..db24f3a527 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(145.9382220568, 145.9382220568, 145.9382220568); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: hsl(195.9034030348, 388.9813639336%, 17.9876851056%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(199.2935266227, 2154.1559841675%, 8.1167706475%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(347.1631207662, 234.6485806965%, -1340219.8783108443%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(190.4112342736, 389.9464516401%, 7.9139613859%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(190.4112342736, 389.9464516401%, 7.9139613859%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 73.552095814, 98.9254037219); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: hsl(234.8931237502, 120.5152085415%, 18.1412125578%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: hsl(133.9801165671, 187.2672802248%, 9.7948015855%); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/srgb.hrx b/spec/core_functions/color/to_space/prophoto_rgb/srgb.hrx new file mode 100644 index 0000000000..c3cb7426b9 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.5723067532 0.5723067532 0.5723067532); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), srgb)} + +<===> middle/output.css +a { + b: color(srgb -0.5198105776 0.5086505738 0.8795642797); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1.6673112998 0.7051691708 1.8296467127); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -44850.2680097921 18045.8704435752 4589.3682169335); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb -0.2294625022 0.280644099 0.3877417299 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb -0.2294625022 0.280644099 0.3877417299 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.2884395914 0.3879427597); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb -0.0372170759 none 0.400041327); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb -0.0854765695 0.2813726012 none); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/srgb_linear.hrx b/spec/core_functions/color/to_space/prophoto_rgb/srgb_linear.hrx new file mode 100644 index 0000000000..878aebe645 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.2871745887 0.2871745887 0.2871745887); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear -0.232837807 0.2221355079 0.7475773304); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -3.2423661674 0.4553849808 4.0248155294); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -128360522797.99591 14437901609.733408 540024616.0904481); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear -0.0430382059 0.0640182408 0.1244386226 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear -0.0430382059 0.0640182408 0.1244386226 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.0676448843 0.1245742709); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear -0.0028805786 none 0.1328972872); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear -0.0079148637 0.0643522253 none); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/xyz.hrx b/spec/core_functions/color/to_space/prophoto_rgb/xyz.hrx new file mode 100644 index 0000000000..b96ff9e511 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.27294679 0.2871745887 0.3127497117); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.1183353555 0.1633232963 0.7325727364); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz -0.4478815578 -0.0732156915 3.8173184875); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -47674467013.18759 -16929933315.113932 -247080732.7777534); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0276021409 0.0456157517 0.1250815881 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0276021409 0.0456157517 0.1250815881 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.041363137 0.1250195241); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.0213812245 none 0.1257953743); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.0181962227 0.0437192439 none); +} diff --git a/spec/core_functions/color/to_space/prophoto_rgb/xyz_d50.hrx b/spec/core_functions/color/to_space/prophoto_rgb/xyz_d50.hrx new file mode 100644 index 0000000000..dce3fc6673 --- /dev/null +++ b/spec/core_functions/color/to_space/prophoto_rgb/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.2769212143 0.2871745887 0.2369490749); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.0909854172 0.1527592329 0.5521676847); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 -0.662628365 -0.1509612194 2.873181106); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -50335581773.96425 -18176260183.033443 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0236937162 0.0438615839 0.0944772554 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0236937162 0.0438615839 0.0944772554 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.0392959056 0.0944772554); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.0162331704 none 0.0944772554); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(prophoto-rgb 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.0201042951 0.0438512858 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/a98_rgb.hrx b/spec/core_functions/color/to_space/rec2020/a98_rgb.hrx new file mode 100644 index 0000000000..454891c7bf --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.5417153213 0.5417153213 0.5417153213); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.13489511 0.4629710676 0.8371559205); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -1.1646526275 0.5655440386 1.9874528803); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -1119831.7269648165 407249.8039869511 187156.9941916847); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.1470288666 0.2765731567 0.3660737554 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.1470288666 0.2765731567 0.3660737554 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.2824471442 0.3668416445); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb 0.1694794184 none 0.3702410451); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.1707192347 0.278433765 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/display_p3.hrx b/spec/core_functions/color/to_space/rec2020/display_p3.hrx new file mode 100644 index 0000000000..eba2196f9e --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.5465835909 0.5465835909 0.5465835909); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 -0.1207745932 0.4564097151 0.8252565585); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -1.2450966031 0.4927082146 1.877624028); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -392808.6781006625 111415.2873247036 -30092.3347141782); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.0867047731 0.2651407977 0.3592704962 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.0867047731 0.2651407977 0.3592704962 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.2685429813 0.3591672285); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.1670371089 none 0.3610354836); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.1260425103 0.2677058987 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/hsl.hrx b/spec/core_functions/color/to_space/rec2020/hsl.hrx new file mode 100644 index 0000000000..c20066b0bd --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 54.6583590878%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(200.8128966593, 189.0732219315%, 29.5081773497%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(204.9795970204, 570.1567645938%, 29.20918492%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(351.6022221471, 202.9643125658%, -14161586.907056699%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(194.5479244469, 123.11735267%, 16.5168092719%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(194.5479244469, 123.11735267%, 16.5168092719%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(189.4362583411, 400.9276505087%, 7.3695655834%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(273.3326815842, 128.5408000864%, 16.5048029077%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(97.48398538, 169.4637013095%, 10.0907863158%); +} diff --git a/spec/core_functions/color/to_space/rec2020/hwb.hrx b/spec/core_functions/color/to_space/rec2020/hwb.hrx new file mode 100644 index 0000000000..1a5f68efc2 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 1 1 1), hwb)); + +<===> white/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(0, 0%, 54.6583590878%); + space: hwb; + channels: 0deg 54.6583590878% 45.3416409122% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: hsl(200.8128966593, 189.0732219315%, 29.5081773497%); + space: hwb; + channels: 200.8128966593deg -26.2838842987% 14.6997610019% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(204.9795970204, 570.1567645938%, 29.20918492%); + space: hwb; + channels: 204.9795970204deg -137.3289587842% -95.7473286243% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(351.6022221471, 202.9643125658%, -14161586.907056702%); + space: hwb; + channels: 171.6022221471deg -42904554.421379425% -14581280.607266026% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(194.5479244469, 123.11735267%, 16.5168092719%, 0.4); + space: hwb; + channels: 194.5479244469deg -3.8182490492% 63.148132407% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(194.5479244469, 123.11735267%, 16.5168092719%, 0); + space: hwb; + channels: 194.5479244469deg -3.8182490492% 63.148132407% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(189.4362583411, 400.9276505087%, 7.3695655834%); + space: hwb; + channels: 189.4362583411deg -22.1770605629% 63.0838082703% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(rec2020 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(273.3326815842, 128.5408000864%, 16.5048029077%); + space: hwb; + channels: 273.3326815842deg -4.7106028025% 62.2797913821% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(rec2020 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(97.48398538, 169.4637013095%, 10.0907863158%); +} diff --git a/spec/core_functions/color/to_space/rec2020/lab.hrx b/spec/core_functions/color/to_space/rec2020/lab.hrx new file mode 100644 index 0000000000..32f8b89779 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(58.0104094495% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(47.1831278283% -5.7697476711 -62.0090026934); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(20.0233737121% -563.3455911654 -257.3742149404); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -11119280450344.598 -4585917925394.642 -119556.2596893311) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(26.3242106967% -12.9991476228 -20.999464924 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(26.3242106967% -12.9991476228 -20.999464924 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(24.4167376804% -31.5965927959 -24.304113724); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: lab(9.8621057796% 42.7961734552 -48.7693303375); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(24.8794631126% -29.5241312368 39.836355697); +} diff --git a/spec/core_functions/color/to_space/rec2020/lch.hrx b/spec/core_functions/color/to_space/rec2020/lch.hrx new file mode 100644 index 0000000000..44cfac5515 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(58.0104094495% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(47.1831278283% 62.2768528686 264.6841092292deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(20.0233737121% 619.3542940851 204.5541138043deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -11119280261600.67 -4585917862614.184 3849800.247779846) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(26.3242106967% 24.6972744653 238.2415478893deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(26.3242106967% 24.6972744653 238.2415478893deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(24.4167376804% 39.8626971017 217.5675010071deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: lch(9.8621057796% 64.8842048882 311.267672367deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(24.8794631126% 49.5843681064 126.5434514525deg); +} diff --git a/spec/core_functions/color/to_space/rec2020/oklab.hrx b/spec/core_functions/color/to_space/rec2020/oklab.hrx new file mode 100644 index 0000000000..1917d1a192 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(63.8020766953% 0.0000000001 0.0000000238); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(55.2815992148% -0.0857471824 -0.1749134266); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(33.9832655696% -2.4377896861 -0.667787683); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -11119280444659.65 -4585917923503.701 0.0024414063) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(36.3512304678% -0.050217455 -0.0580072349 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(36.3512304678% -0.050217455 -0.0580072349 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(34.1361541836% -0.1128551253 -0.067830888); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(25.3247541535% 0.0750438961 -0.1364735034); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(34.13560351% -0.0917726115 0.0859786399); +} diff --git a/spec/core_functions/color/to_space/rec2020/oklch.hrx b/spec/core_functions/color/to_space/rec2020/oklch.hrx new file mode 100644 index 0000000000..514f8f6893 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755622419deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(63.8020766953% 0.0000000238 89.8755631672deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(55.2815992148% 0.1948006317 243.8846858979deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(33.9832655696% 2.5275994429 195.319325973deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -11119280444659.652 -4585917923503.7 -0.009765625) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(36.3512304678% 0.0767243904 229.1169268509deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(36.3512304678% 0.0767243904 229.1169268509deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(34.1361541836% 0.1316712143 211.0077162465deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(25.3247541535% 0.155745316 298.8054651649deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(34.13560351% 0.1257558697 136.866949571deg); +} diff --git a/spec/core_functions/color/to_space/rec2020/prophoto_rgb.hrx b/spec/core_functions/color/to_space/rec2020/prophoto_rgb.hrx new file mode 100644 index 0000000000..b9116b823b --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.4728514184 0.4728514184 0.4728514184); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.3205854039 0.3793783564 0.7698022311); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -0.5478493377 0.3839894918 2.1828841348); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -20568106.26542821 -4493352.638848251 785798.3189394); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.1520851228 0.1987719462 0.283976665 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.1520851228 0.1987719462 0.283976665 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.1963011404 0.2840567616); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.1451585947 none 0.2808956158); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.1184473522 0.1951112391 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/rec2020.hrx b/spec/core_functions/color/to_space/rec2020/rec2020.hrx new file mode 100644 index 0000000000..a2767e9473 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/rec2020.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), rec2020)} + +<===> in_range/output.css +a { + b: color(rec2020 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), rec2020)} + +<===> out_of_range/output.css +a { + b: color(rec2020 -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/rgb.hrx b/spec/core_functions/color/to_space/rec2020/rgb.hrx new file mode 100644 index 0000000000..be92a9d204 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(139.3788156739, 139.3788156739, 139.3788156739); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: hsl(200.8128966593, 189.0732219315%, 29.5081773497%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(204.9795970204, 570.1567645938%, 29.20918492%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(351.6022221471, 202.9643125658%, -14161586.907056699%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(194.5479244469, 123.11735267%, 16.5168092719%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(194.5479244469, 123.11735267%, 16.5168092719%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 70.4374731297, 94.1362889109); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: rgb(48.0971037271, 0, 96.1865319755); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: rgb(14.8533924164, 69.337066059, 0); +} diff --git a/spec/core_functions/color/to_space/rec2020/srgb.hrx b/spec/core_functions/color/to_space/rec2020/srgb.hrx new file mode 100644 index 0000000000..8126230833 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.5465835909 0.5465835909 0.5465835909); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), srgb)} + +<===> middle/output.css +a { + b: color(srgb -0.262838843 0.4659375855 0.85300239); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1.3732895878 0.5707880468 1.9574732862); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -429045.5442137942 145813.8060726603 65354.787400083); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb -0.0381824905 0.2699077119 0.3685186759 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb -0.0381824905 0.2699077119 0.3685186759 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.2762253848 0.3691619173); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.188616093 none 0.3772020862); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb 0.0582485977 0.271910063 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/srgb_linear.hrx b/spec/core_functions/color/to_space/rec2020/srgb_linear.hrx new file mode 100644 index 0000000000..705d562d37 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.2597194371 0.2597194371 0.2597194371); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear -0.0561682415 0.1838568265 0.6975942253); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -2.0689650071 0.28550882 4.7113611346); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -28986940627436.953 2174258821934.0952 316855134441.09607); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear -0.0029553011 0.0592131472 0.111863462 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear -0.0029553011 0.0592131472 0.111863462 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.0620141462 0.1122716521); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.0296680112 none 0.1174471704); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear 0.004719249 0.0600927379 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/xyz.hrx b/spec/core_functions/color/to_space/rec2020/xyz.hrx new file mode 100644 index 0000000000..acc6fecaf8 --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.2468518784 0.2597194371 0.282849466); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.1684834116 0.1699060269 0.6839147362); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.0991815219 0.1043683721 4.4723366127); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -11119280444659.668 -4585917923503.705 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0401441609 0.0497946582 0.1133305869 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0401441609 0.0497946582 0.1133305869 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.0438868281 0.1133305869); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.0321156515 none 0.1117721115); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.0223529743 0.0435473713 none); +} diff --git a/spec/core_functions/color/to_space/rec2020/xyz_d50.hrx b/spec/core_functions/color/to_space/rec2020/xyz_d50.hrx new file mode 100644 index 0000000000..45dbca47dd --- /dev/null +++ b/spec/core_functions/color/to_space/rec2020/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.2504463303 0.2597194371 0.2142957029); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.1461303676 0.1615955499 0.5152185696); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 -0.1181465111 0.0299487833 3.363289424); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -11757457714802.084 -4871490904380.732 33734088609.397465); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0375225748 0.0485727436 0.0855889676 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0375225748 0.0485727436 0.0855889676 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.0422970228 0.0856324257); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.0283237743 none 0.0839247274); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(rec2020 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.0243454002 0.0437664763 none); +} diff --git a/spec/core_functions/color/to_space/rgb/a98_rgb.hrx b/spec/core_functions/color/to_space/rgb/a98_rgb.hrx new file mode 100644 index 0000000000..765b6c76bc --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/a98_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.660735938 0.660735938 0.660735938); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.3199480242 0.5287075634 0.8521762133); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), a98-rgb)} + +<===> float/output.css +a { + b: color(a98-rgb 0.2781926905 0.395603604 0.7684686532); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb 0.1411766693 0.3918977213 1.5718485866); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -6760.0211192379 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.0827079329 0.1047180692 0.1375163198 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.0827079329 0.1047180692 0.1375163198 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.1047180692 0.1375163198); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb 0.0615069668 none 0.1360938515); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.0827079329 0.1047180692 none); +} diff --git a/spec/core_functions/color/to_space/rgb/display_p3.hrx b/spec/core_functions/color/to_space/rgb/display_p3.hrx new file mode 100644 index 0000000000..16cb2d93fa --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/display_p3.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.6666666667 0.6666666667 0.6666666667); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.2644791221 0.525654809 0.8414340148); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), display-p3)} + +<===> float/output.css +a { + b: color(display-p3 0.2464159945 0.3912935228 0.7592218197); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -0.0462648785 0.3843286419 1.5086360967); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -3614.8515104566 -948.8907591358 -719.4436054746); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.0477705982 0.0773808537 0.1142571507 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.0477705982 0.0773808537 0.1142571507 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.0765677073 0.1139614092); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.0322534105 none 0.1113368327); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.0477705982 0.0773808537 none); +} diff --git a/spec/core_functions/color/to_space/rgb/hsl.hrx b/spec/core_functions/color/to_space/rgb/hsl.hrx new file mode 100644 index 0000000000..bc11e12384 --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/hsl.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 66.6666666667%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, hsl)} + +<===> middle/output.css +a { + b: hsl(207.2727272727, 73.3333333333%, 50%); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), hsl)} + +<===> float/output.css +a { + b: hsl(219.6637272829, 59.9519025013%, 49.0816263243%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(220, 281.25%, 68.6274509804%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(0, 100%, -196078.2352941177%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(210, 50%, 7.8431372549%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(210, 50%, 7.8431372549%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), hsl)} + +<===> missing/red/output.css +a { + b: hsl(200, 100%, 5.8823529412%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), hsl)} + +<===> missing/green/output.css +a { + b: hsl(260, 100%, 5.8823529412%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(90, 100%, 3.9215686275%); +} diff --git a/spec/core_functions/color/to_space/rgb/hwb.hrx b/spec/core_functions/color/to_space/rgb/hwb.hrx new file mode 100644 index 0000000000..bfa8a73b6e --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/hwb.hrx @@ -0,0 +1,165 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(#000, hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(#fff, hwb)); + +<===> white/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(#aaa, hwb)); + +<===> gray/output.css +a { + value: #aaaaaa; + space: hwb; + channels: 0deg 66.6666666667% 33.3333333333% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(#28d, hwb)); + +<===> middle/output.css +a { + value: #2288dd; + space: hwb; + channels: 207.2727272727deg 13.3333333333% 13.3333333333% / 1; +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect( + color.to-space(rgb(50.123456789 100.987654321 200.192837465), hwb) +); + +<===> float/output.css +a { + value: hsl(219.6637272829, 59.9519025013%, 49.0816263243%); + space: hwb; + channels: 219.6637272829deg 19.6562575643% 21.4930049157% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(220, 281.25%, 68.6274509804%); + space: hwb; + channels: 220deg -19.6078431373% -56.862745098% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color.change(black, $red: -999999), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(0, 100%, -196078.2352941177%); + space: hwb; + channels: 180deg -392156.4705882354% 100% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(rgb(10 20 30 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(210, 50%, 7.8431372549%, 0.4); + space: hwb; + channels: 210deg 3.9215686275% 88.2352941176% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(rgb(10 20 30 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(210, 50%, 7.8431372549%, 0); + space: hwb; + channels: 210deg 3.9215686275% 88.2352941176% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(rgb(none 20 30), hwb)); + +<===> missing/red/output.css +a { + value: #00141e; + space: hwb; + channels: 200deg 0% 88.2352941176% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(rgb(10 none 30), hwb)); + +<===> missing/green/output.css +a { + value: #0a001e; + space: hwb; + channels: 260deg 0% 88.2352941176% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(rgb(10 20 none), hwb)} + +<===> missing/blue/output.css +a { + b: #0a1400; +} diff --git a/spec/core_functions/color/to_space/rgb/lab.hrx b/spec/core_functions/color/to_space/rgb/lab.hrx new file mode 100644 index 0000000000..0180bfcb9d --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/lab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, lab)} + +<===> gray/output.css +a { + b: lab(69.61016583% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, lab)} + +<===> middle/output.css +a { + b: lab(54.4372323192% -5.0725440763 -52.2489046102); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), lab)} + +<===> float/output.css +a { + b: lab(43.5786666948% 10.234304882 -57.7772280218); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(57.5459692675% 67.2901769646 -142.8196552841); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -152693379.43919498 -78732523.77333494 -7157502.161212263) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(5.8508980612% -1.4961467566 -8.2549264931 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(5.8508980612% -1.4961467566 -8.2549264931 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), lab)} + +<===> missing/red/output.css +a { + b: lab(5.2408778377% -4.2109320426 -9.2418429616); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), lab)} + +<===> missing/green/output.css +a { + b: lab(1.3209405601% 7.1508367815 -15.0002069297); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(5.1399777246% -5.9321982521 7.5003938134); +} diff --git a/spec/core_functions/color/to_space/rgb/lch.hrx b/spec/core_functions/color/to_space/rgb/lch.hrx new file mode 100644 index 0000000000..3fda67cbeb --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/lch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, lch)} + +<===> gray/output.css +a { + b: lch(69.61016583% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, lch)} + +<===> middle/output.css +a { + b: lch(54.4372323192% 52.4945591121 264.454862058deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), lch)} + +<===> float/output.css +a { + b: lch(43.5786666948% 58.6766484583 280.0448319605deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(57.5459692675% 157.8778700497 295.2276977506deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -152693379.43919504 -78732523.77333494 -7157502.161212466) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(5.8508980612% 8.3894139559 259.7270636253deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(5.8508980612% 8.3894139559 259.7270636253deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), lch)} + +<===> missing/red/output.css +a { + b: lch(5.2408778377% 10.1559642572 245.5042015895deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), lch)} + +<===> missing/green/output.css +a { + b: lch(1.3209405601% 16.6174809948 295.4878788717deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(5.1399777246% 9.5627863857 128.3411151091deg); +} diff --git a/spec/core_functions/color/to_space/rgb/oklab.hrx b/spec/core_functions/color/to_space/rgb/oklab.hrx new file mode 100644 index 0000000000..8b3c9b638a --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/oklab.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, oklab)} + +<===> gray/output.css +a { + b: oklab(73.8018666132% 0.0000000001 0.0000000275); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, oklab)} + +<===> middle/output.css +a { + b: oklab(61.3651179384% -0.0551812368 -0.1461735753); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), oklab)} + +<===> float/output.css +a { + b: oklab(52.7265723906% -0.0228233564 -0.1626243735); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(69.4063330454% -0.0570651814 -0.4015686842); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -152693379.43919483 -78732523.77333483 -7157502.161212221) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(18.6989144442% -0.0089460528 -0.0237039533 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(18.6989144442% -0.0089460528 -0.0237039533 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), oklab)} + +<===> missing/red/output.css +a { + b: oklab(17.9105838927% -0.0229309101 -0.0273761686); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), oklab)} + +<===> missing/green/output.css +a { + b: oklab(12.5934961979% 0.0296887787 -0.0622382911); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(17.4737572915% -0.0289569456 0.036012989); +} diff --git a/spec/core_functions/color/to_space/rgb/oklch.hrx b/spec/core_functions/color/to_space/rgb/oklch.hrx new file mode 100644 index 0000000000..4708e8d674 --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/oklch.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, oklch)} + +<===> gray/output.css +a { + b: oklch(73.8018666132% 0.0000000275 89.8755625379deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, oklch)} + +<===> middle/output.css +a { + b: oklch(61.3651179384% 0.1562423854 249.3182340149deg); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), oklch)} + +<===> float/output.css +a { + b: oklch(52.7265723906% 0.1642181246 262.0110592016deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(69.4063330454% 0.405603061 261.9120979439deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -152693379.43919486 -78732523.77333483 -7157502.16121231) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(18.6989144442% 0.0253359283 249.3231108283deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(18.6989144442% 0.0253359283 249.3231108283deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), oklch)} + +<===> missing/red/output.css +a { + b: oklch(17.9105838927% 0.0357110801 230.049682151deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), oklch)} + +<===> missing/green/output.css +a { + b: oklch(12.5934961979% 0.0689567144 295.5019774012deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(17.4737572915% 0.0462108221 128.8016996944deg); +} diff --git a/spec/core_functions/color/to_space/rgb/prophoto_rgb.hrx b/spec/core_functions/color/to_space/rgb/prophoto_rgb.hrx new file mode 100644 index 0000000000..19ba598f09 --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/prophoto_rgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.6027153447 0.6027153447 0.6027153447); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.3990854669 0.4493912175 0.7905294798); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), prophoto-rgb)} + +<===> float/output.css +a { + b: color(prophoto-rgb 0.3371488337 0.3261543399 0.6930068512); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb 0.6182230836 0.3944820605 1.6451734949); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -40436.5951245925 -15876.4400699537 -5962.4442405194); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.0568847736 0.0623636876 0.0861178613 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.0568847736 0.0623636876 0.0861178613 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.0608214606 0.0859153209); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.0427390372 none 0.0828155088); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.0459932777 0.0604706464 none); +} diff --git a/spec/core_functions/color/to_space/rgb/rec2020.hrx b/spec/core_functions/color/to_space/rgb/rec2020.hrx new file mode 100644 index 0000000000..90e0b68807 --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/rec2020.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.630170586 0.630170586 0.630170586); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.327926145 0.4744067013 0.818404902); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), rec2020)} + +<===> float/output.css +a { + b: color(rec2020 0.2689744026 0.3372277303 0.7270775308); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 0.3600781868 0.3645236247 1.5702758315); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -6394.9114299566 -2369.6504581671 -1240.1892051013); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.0214656524 0.0305541381 0.055318427 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.0214656524 0.0305541381 0.055318427 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.029610358 0.055094541); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.0111000377 none 0.0525478256); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.0189351452 0.0298903102 none); +} diff --git a/spec/core_functions/color/to_space/rgb/rgb.hrx b/spec/core_functions/color/to_space/rgb/rgb.hrx new file mode 100644 index 0000000000..8e3ceaab71 --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/rgb.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, rgb)} + +<===> in_range/output.css +a { + b: #28d; +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), rgb)} + +<===> out_of_range/output.css +a { + b: hsl(220, 281.25%, 68.6274509804%); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), rgb)} + +<===> missing/red/output.css +a { + b: rgb(none 20 30); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), rgb)} + +<===> missing/green/output.css +a { + b: rgb(10 none 30); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), rgb)} + +<===> missing/blue/output.css +a { + b: rgb(10 20 none); +} diff --git a/spec/core_functions/color/to_space/rgb/srgb.hrx b/spec/core_functions/color/to_space/rgb/srgb.hrx new file mode 100644 index 0000000000..c906bbf3da --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/srgb.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.6666666667 0.6666666667 0.6666666667); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.1333333333 0.5333333333 0.8666666667); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), srgb)} + +<===> float/output.css +a { + b: color(srgb 0.1965625756 0.3960300169 0.7850699508); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -0.1960784314 0.3921568627 1.568627451); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -3921.5647058824 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.0392156863 0.0784313725 0.1176470588 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.0392156863 0.0784313725 0.1176470588 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.0784313725 0.1176470588); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.0392156863 none 0.1176470588); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb 0.0392156863 0.0784313725 none); +} diff --git a/spec/core_functions/color/to_space/rgb/srgb_linear.hrx b/spec/core_functions/color/to_space/rgb/srgb_linear.hrx new file mode 100644 index 0000000000..cf062b4c7a --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/srgb_linear.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.4019777798 0.4019777798 0.4019777798); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.0159962934 0.2462013267 0.7230551289); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), srgb-linear)} + +<===> float/output.css +a { + b: color(srgb-linear 0.0320438415 0.130102957 0.5788301943); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -0.0318960331 0.1274376804 2.8142418811); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -370263787.91908944 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.0030352698 0.0069954102 0.0129830323 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.0030352698 0.0069954102 0.0129830323 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.0069954102 0.0129830323); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.0030352698 none 0.0129830323); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear 0.0030352698 0.0069954102 none); +} diff --git a/spec/core_functions/color/to_space/rgb/xyz.hrx b/spec/core_functions/color/to_space/rgb/xyz.hrx new file mode 100644 index 0000000000..8a1fffc1c1 --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/xyz.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.3820621634 0.4019777798 0.4377770168); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.2251320227 0.2316759373 0.7169422823); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), xyz)} + +<===> float/output.css +a { + b: color(xyz 0.1642050952 0.1416464224 0.5663237374); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.5403326817 0.2875237342 2.689600722); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -152693379.439195 -78732523.77333492 -7157502.1612122655); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0060963544 0.0065855902 0.0132332803 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0060963544 0.0065855902 0.0132332803 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.0059401734 0.0131746061); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.0035949053 none 0.0123994639); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.0037531665 0.005648315 none); +} diff --git a/spec/core_functions/color/to_space/rgb/xyz_d50.hrx b/spec/core_functions/color/to_space/rgb/xyz_d50.hrx new file mode 100644 index 0000000000..e7d2fe6f74 --- /dev/null +++ b/spec/core_functions/color/to_space/rgb/xyz_d50.hrx @@ -0,0 +1,129 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(#000, xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(#fff, xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(#aaa, xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.3876254351 0.4019777798 0.3316737162); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(#28d, xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.2052538337 0.2238890642 0.5404574845); +} + +<===> +================================================================================ +<===> float/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), xyz-d50)} + +<===> float/output.css +a { + b: color(xyz-d50 0.1469006816 0.1354872326 0.4264190127); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(rgb(0, 100, 0), $red: -50, $blue: 400), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 0.4378313293 0.2548605759 2.0215760182); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color.change(black, $red: -999999), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -161459355.2194338 -82381166.54311071 -5155523.903641009); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0058754618 0.0064772745 0.0099925616 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 30 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0058754618 0.0064772745 0.0099925616 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(none 20 30), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.0058019477 0.0099502987); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 none 30), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.003181169 none 0.0093134379); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(rgb(10 20 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.00401787 0.0056902455 none); +} diff --git a/spec/core_functions/color/to_space/srgb/a98_rgb.hrx b/spec/core_functions/color/to_space/srgb/a98_rgb.hrx new file mode 100644 index 0000000000..a0ad947a8c --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.4961036984 0.4961036984 0.4961036984); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.2814316253 0.3994051501 0.7833135189); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -0.8376211647 0.3994051501 2.0319913216); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -2858844.9973722333 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.1551137687 0.2123166098 0.3014984164 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.1551137687 0.2123166098 0.3014984164 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.2123166098 0.3014984164); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb 0.1058822156 none 0.2988751674); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.1551137687 0.2123166098 none); +} diff --git a/spec/core_functions/color/to_space/srgb/display_p3.hrx b/spec/core_functions/color/to_space/srgb/display_p3.hrx new file mode 100644 index 0000000000..0944312c66 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.2498513331 0.3952400722 0.77356175); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -0.9057671336 0.3411005959 1.9199196788); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -921788.227771966 -241977.733146743 -183469.5263235596); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.1237968384 0.1975241128 0.2918191239 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.1237968384 0.1975241128 0.2918191239 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.196438359 0.2914615969); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.0878773188 none 0.2867666162); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.1237968384 0.1975241128 none); +} diff --git a/spec/core_functions/color/to_space/srgb/hsl.hrx b/spec/core_functions/color/to_space/srgb/hsl.hrx new file mode 100644 index 0000000000..b60a50131e --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 50%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(220, 60%, 50%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(212, 300%, 50%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(0, 100%, -49999950%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(210, 50%, 20%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(210, 50%, 20%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(200, 100%, 15%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(260, 100%, 15%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(90, 100%, 10%); +} diff --git a/spec/core_functions/color/to_space/srgb/hwb.hrx b/spec/core_functions/color/to_space/srgb/hwb.hrx new file mode 100644 index 0000000000..162825c902 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb 1 1 1), hwb)); + +<===> white/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(0, 0%, 50%); + space: hwb; + channels: 0deg 50% 50% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: #3366cc; + space: hwb; + channels: 220deg 20% 20% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(212, 300%, 50%); + space: hwb; + channels: 212deg -100% -100% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(0, 100%, -49999950%); + space: hwb; + channels: 180deg -99999900% 100% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(210, 50%, 20%, 0.4); + space: hwb; + channels: 210deg 10% 70% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(210, 50%, 20%, 0); + space: hwb; + channels: 210deg 10% 70% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(200, 100%, 15%); + space: hwb; + channels: 200deg 0% 70% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(260, 100%, 15%); + space: hwb; + channels: 260deg 0% 70% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(srgb 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(90, 100%, 10%); +} diff --git a/spec/core_functions/color/to_space/srgb/lab.hrx b/spec/core_functions/color/to_space/srgb/lab.hrx new file mode 100644 index 0000000000..509e42d796 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(53.3889647411% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(44.1210142293% 10.9543336098 -59.0857381981); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(48.6432537296% 68.9299544627 -213.4229545471); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -91096581353071.61 -46971674760177.555 -4270152250925.234) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(20.2042266123% -3.1075752886 -18.9913351297 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(20.2042266123% -3.1075752886 -18.9913351297 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(19.2964565453% -7.7361660103 -20.488348653); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: lab(6.0247531381% 29.4610612512 -41.8404017236); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(18.3483752329% -17.6137840535 25.305473968); +} diff --git a/spec/core_functions/color/to_space/srgb/lch.hrx b/spec/core_functions/color/to_space/srgb/lch.hrx new file mode 100644 index 0000000000..df1133f6f7 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(53.3889647411% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(44.1210142293% 60.0926108873 280.5032243387deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(48.6432537296% 224.278166904 287.899080689deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -91096581353071.64 -46971674760177.555 -4270152250925.3564) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(20.2042266123% 19.2439038187 260.7069785652deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(20.2042266123% 19.2439038187 260.7069785652deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(19.2964565453% 21.9002441782 249.3140373711deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: lch(6.0247531381% 51.1719976788 305.1505063293deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(18.3483752329% 30.8320028773 124.8397077198deg); +} diff --git a/spec/core_functions/color/to_space/srgb/oklab.hrx b/spec/core_functions/color/to_space/srgb/oklab.hrx new file mode 100644 index 0000000000..7b01ff1f3a --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(59.8180726623% 0 0.0000000223); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(53.248255955% -0.0225118457 -0.1663491641); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(49.0997083563% -2.0235857478 -0.6049594977); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -91096581353071.4 -46971674760177.49 -4270152250925.199) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(31.3834098842% -0.0190902788 -0.0525285242 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(31.3834098842% -0.0190902788 -0.0525285242 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(30.4674630654% -0.0359109243 -0.0568929135); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(21.1364004026% 0.0335334923 -0.1181436252); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(28.8978411941% -0.0558272225 0.0596397714); +} diff --git a/spec/core_functions/color/to_space/srgb/oklch.hrx b/spec/core_functions/color/to_space/srgb/oklch.hrx new file mode 100644 index 0000000000..860f973ecb --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(59.8180726623% 0.0000000223 89.8755628286deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(53.248255955% 0.1678655044 262.2930469968deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(49.0997083563% 2.1120784248 196.6442570354deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -91096581353071.39 -46971674760177.49 -4270152250925.1875) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(31.3834098842% 0.0558899329 250.0274938863deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(31.3834098842% 0.0558899329 250.0274938863deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(30.4674630654% 0.0672785114 237.7397947754deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(21.1364004026% 0.1228104689 285.8458860201deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(28.8978411941% 0.0816919892 133.1088653771deg); +} diff --git a/spec/core_functions/color/to_space/srgb/prophoto_rgb.hrx b/spec/core_functions/color/to_space/srgb/prophoto_rgb.hrx new file mode 100644 index 0000000000..54823fa969 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.4246723949 0.4246723949 0.4246723949); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.3437112182 0.3305199405 0.7092276973); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb 0.4212484437 0.3577643231 2.2446463591); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -65386295.193253286 -25672329.57753762 -9641319.650744053); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.1331358788 0.1476592872 0.2235807496 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.1331358788 0.1476592872 0.2235807496 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.1451114907 0.2232691012); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.0991241424 none 0.2163131073); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.1013444503 0.1422873785 none); +} diff --git a/spec/core_functions/color/to_space/srgb/rec2020.hrx b/spec/core_functions/color/to_space/srgb/rec2020.hrx new file mode 100644 index 0000000000..ffef61377c --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.4500400319 0.4500400319 0.4500400319); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.2739398263 0.3416365439 0.7427746502); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -0.6026796755 0.3067863382 2.048941054); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -2540376.5945026004 -941367.6801989076 -492696.4947353633); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.0912836575 0.1341693654 0.2300559367 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.0912836575 0.1341693654 0.2300559367 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.1318794997 0.2297011255); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.0425725358 none 0.2236924669); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.0773513907 0.1314145084 none); +} diff --git a/spec/core_functions/color/to_space/srgb/rgb.hrx b/spec/core_functions/color/to_space/srgb/rgb.hrx new file mode 100644 index 0000000000..92850bcbc8 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(127.5, 127.5, 127.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: #3366cc; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(212, 300%, 50%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(0, 100%, -49999950%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: rgba(25.5, 51, 76.5, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: rgba(25.5, 51, 76.5, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 51, 76.5); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: rgb(25.5, 0, 76.5); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: rgb(25.5, 51, 0); +} diff --git a/spec/core_functions/color/to_space/srgb/srgb.hrx b/spec/core_functions/color/to_space/srgb/srgb.hrx new file mode 100644 index 0000000000..ebbb15b267 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/srgb.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), srgb)} + +<===> in_range/output.css +a { + b: color(srgb 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), srgb)} + +<===> out_of_range/output.css +a { + b: color(srgb -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/srgb/srgb_linear.hrx b/spec/core_functions/color/to_space/srgb/srgb_linear.hrx new file mode 100644 index 0000000000..7acc58c9bd --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.2140411405 0.2140411405 0.2140411405); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear 0.0331047666 0.1328683216 0.6038273389); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -1 0.1328683216 4.9538457516); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -220898675516573.56 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear 0.0100228256 0.0331047666 0.0732389559 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear 0.0100228256 0.0331047666 0.0732389559 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.0331047666 0.0732389559); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.0100228256 none 0.0732389559); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear 0.0100228256 0.0331047666 none); +} diff --git a/spec/core_functions/color/to_space/srgb/xyz.hrx b/spec/core_functions/color/to_space/srgb/xyz.hrx new file mode 100644 index 0000000000..663cfe2175 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.2034366706 0.2140411405 0.233103163); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.1701429663 0.1456543203 0.5904344526); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.5291948186 0.2400138509 4.7052960558); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -91096581353071.61 -46971674760177.55 -4270152250925.2314); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.0291892916 0.0310940256 0.0737556471 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.0291892916 0.0310940256 0.0737556471 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.028962782 0.0735618977); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.0173515455 none 0.0698097318); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.0159710671 0.0258067358 none); +} diff --git a/spec/core_functions/color/to_space/srgb/xyz_d50.hrx b/spec/core_functions/color/to_space/srgb/xyz_d50.hrx new file mode 100644 index 0000000000..ba6d0d2d6a --- /dev/null +++ b/spec/core_functions/color/to_space/srgb/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.2063989463 0.2140411405 0.1766063301); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.152004951 0.1392210573 0.4445526951); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 0.3238971106 0.1730595843 3.5365131761); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -96326345922671.53 -49148448135198.27 -3075775809210.909); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0275998758 0.0304021191 0.0556533029 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0275998758 0.0304021191 0.0556533029 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.0281721088 0.0555137459); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.014849525 none 0.0524394483); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.0171209617 0.0259623875 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/a98_rgb.hrx b/spec/core_functions/color/to_space/srgb_linear/a98_rgb.hrx new file mode 100644 index 0000000000..418a940e36 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.7296583818 0.7296583818 0.7296583818); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb 0.5391048013 0.6592557425 0.8950095649); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -0.7934333717 0.6592557425 1.3497959658); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -459.2276214951 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb 0.3933623369 0.4810314783 0.5747978617 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb 0.3933623369 0.4810314783 0.5747978617 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.4810314783 0.5747978617); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb 0.3013559074 none 0.5674699335); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.3933623369 0.4810314783 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/display_p3.hrx b/spec/core_functions/color/to_space/srgb_linear/display_p3.hrx new file mode 100644 index 0000000000..ecb7f6fdeb --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.7353569831 0.7353569831 0.7353569831); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 0.5225476892 0.6601803521 0.8864121553); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -0.8815767709 0.6290624928 1.3029857539); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -307.4724395956 -80.6737432685 -61.1542078437); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 0.377671895 0.4807798914 0.5742767089 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 0.377671895 0.4807798914 0.5742767089 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.4769934816 0.5727260345); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.3175781541 none 0.5609588905); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.377671895 0.4807798914 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/hsl.hrx b/spec/core_functions/color/to_space/srgb_linear/hsl.hrx new file mode 100644 index 0000000000..3141acf37c --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(0, 0%, 100%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(0, 0%, 73.5356983052%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(214.3023060477, 69.2456926348%, 69.5430478913%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(197.5434618594, 666.1615765111%, 17.6628023075%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(0, 100%, -16678.2577069634%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(205.3925362149, 25.148533711%, 46.6510851344%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(205.3925362149, 25.148533711%, 46.6510851344%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(190.2052342776, 100%, 29.191574503%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(275.8860614996, 100%, 29.191574503%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(76.7592364631, 100%, 24.2264602241%); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/hwb.hrx b/spec/core_functions/color/to_space/srgb_linear/hwb.hrx new file mode 100644 index 0000000000..a384818f4c --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear 1 1 1), hwb)); + +<===> white/output.css +a { + value: white; + space: hwb; + channels: 0deg 100% 0% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(0, 0%, 73.5356983052%); + space: hwb; + channels: 0deg 73.5356983052% 26.4643016948% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: hsl(214.3023060477, 69.2456926348%, 69.5430478913%); + space: hwb; + channels: 214.3023060477deg 48.4529204482% 9.3668246656% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(197.5434618594, 666.1615765111%, 17.6628023075%); + space: hwb; + channels: 197.5434618594deg -100% -35.3256046149% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(0, 100%, -16678.2577069634%); + space: hwb; + channels: 180deg -33356.5154139268% 100% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(205.3925362149, 25.148533711%, 46.6510851344%, 0.4); + space: hwb; + channels: 205.3925362149deg 34.9190212628% 41.616850994% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(205.3925362149, 25.148533711%, 46.6510851344%, 0); + space: hwb; + channels: 205.3925362149deg 34.9190212628% 41.616850994% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(190.2052342776, 100%, 29.191574503%); + space: hwb; + channels: 190.2052342776deg 0% 41.616850994% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(srgb-linear 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(275.8860614996, 100%, 29.191574503%); + space: hwb; + channels: 275.8860614996deg 0% 41.616850994% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(76.7592364631, 100%, 24.2264602241%); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/lab.hrx b/spec/core_functions/color/to_space/srgb_linear/lab.hrx new file mode 100644 index 0000000000..201237fb6a --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), lab)} + +<===> white/output.css +a { + b: lab(100% 0 0); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(76.0692610142% 0 0); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(68.0021326658% -3.4788867492 -36.298343272); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(50.1566645274% -199.4292910489 -127.4603757066); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -412390.3868751603 -212638.7932325045 -19330.7993847731) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(49.9553149355% -7.5157058766 -17.8791167699 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(49.9553149355% -7.5157058766 -17.8791167699 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(47.1789302985% -22.7267758708 -22.4056108481); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: lab(23.8148183096% 52.2336661374 -59.2206654307); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(47.7042083773% -24.5180464109 51.183897624); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/lch.hrx b/spec/core_functions/color/to_space/srgb_linear/lch.hrx new file mode 100644 index 0000000000..26f865afee --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), lch)} + +<===> white/output.css +a { + b: lch(100% 0 none); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(76.0692610142% 0 none); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(68.0021326658% 36.4646730043 264.5254095776deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(50.1566645274% 236.6816205445 212.5836894898deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -412390.3868751603 -212638.7932325045 -19330.7993847737) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(49.9553149355% 19.3945521035 247.1999530707deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(49.9553149355% 19.3945521035 247.1999530707deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(47.1789302985% 31.9142247118 224.5922863586deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: lch(23.8148183096% 78.9648218652 311.4128591679deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(47.7042083773% 56.7532023396 115.5952944453deg); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/oklab.hrx b/spec/core_functions/color/to_space/srgb_linear/oklab.hrx new file mode 100644 index 0000000000..901af5ef0f --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), oklab)} + +<===> white/output.css +a { + b: oklab(99.9999993474% 0.0000000001 0.0000000373); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(79.3700520804% 0.0000000001 0.0000000296); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(72.8143374355% -0.0250833833 -0.0997563344); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(41.5806830952% -1.9917329546 -0.3816984711); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -412390.3868751598 -212638.7932325045 -19330.799384773) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(56.8480554239% -0.0271159546 -0.0484208297 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(56.8480554239% -0.0271159546 -0.0484208297 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(54.0246595647% -0.0760370977 -0.061145727); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(37.7328569492% 0.1076561145 -0.1664592467); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(53.8237207745% -0.0823086169 0.1108579968); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/oklch.hrx b/spec/core_functions/color/to_space/srgb_linear/oklch.hrx new file mode 100644 index 0000000000..e638aad55f --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), oklch)} + +<===> white/output.css +a { + b: oklch(99.9999993474% 0.0000000373 89.8755630959deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(79.3700520804% 0.0000000296 89.8755628773deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(72.8143374355% 0.1028615689 255.885778774deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(41.5806830952% 2.0279777823 190.8487076701deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -412390.3868751598 -212638.7932325044 -19330.7993847733) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(56.8480554239% 0.055496412 240.7509124531deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(56.8480554239% 0.055496412 240.7509124531deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(54.0246595647% 0.0975727429 218.8047277574deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(37.7328569492% 0.1982385426 302.8924282818deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(53.8237207745% 0.138073183 126.5927383995deg); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/prophoto_rgb.hrx b/spec/core_functions/color/to_space/srgb_linear/prophoto_rgb.hrx new file mode 100644 index 0000000000..87eb4569f0 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.6803950001 0.6803950001 0.6803950001); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.5584197658 0.5940140048 0.8477459947); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -0.302285213 0.5192197728 1.3694597345); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -1512.946773752 -594.0215467819 -223.0865568571); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.3626946772 0.4009240289 0.4977561426 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.3626946772 0.4009240289 0.4977561426 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.3894388678 0.4961157804); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.2705939482 none 0.4744752789); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.3064298164 0.3910752998 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/rec2020.hrx b/spec/core_functions/color/to_space/srgb_linear/rec2020.hrx new file mode 100644 index 0000000000..4f1d97d51e --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.7054355531 0.7054355531 0.7054355531); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 0.5322900823 0.6209100246 0.8693839915); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -0.6359299305 0.5603508935 1.336426667); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -446.5956338945 -165.4289951275 -86.5355205509); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.3568250491 0.4265433858 0.5284543831 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.3568250491 0.4265433858 0.5284543831 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.4180412871 0.5268436405); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.2448919266 none 0.5108839287); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.3374893111 0.4223703123 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/rgb.hrx b/spec/core_functions/color/to_space/srgb_linear/rgb.hrx new file mode 100644 index 0000000000..81f98106e9 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), rgb)} + +<===> white/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(187.5160306784, 187.5160306784, 187.5160306784); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: rgb(123.5549471428, 169.6221965809, 231.1145971027); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(197.5434618594, 666.1615765111%, 17.6628023075%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(0, 100%, -16678.2577069634%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: rgba(89.0435042202, 123.5549471428, 148.8770299654, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: rgba(89.0435042202, 123.5549471428, 148.8770299654, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 123.5549471428, 148.8770299654); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: rgb(89.0435042202, 0, 148.8770299654); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: rgb(89.0435042202, 123.5549471428, 0); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/srgb.hrx b/spec/core_functions/color/to_space/srgb_linear/srgb.hrx new file mode 100644 index 0000000000..aa7bf00340 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), srgb)} + +<===> white/output.css +a { + b: color(srgb 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.7353569831 0.7353569831 0.7353569831); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), srgb)} + +<===> middle/output.css +a { + b: color(srgb 0.4845292045 0.6651850846 0.9063317533); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1 0.6651850846 1.3532560461); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -333.5651541393 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb 0.3491902126 0.4845292045 0.5838314901 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb 0.3491902126 0.4845292045 0.5838314901 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.4845292045 0.5838314901); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.3491902126 none 0.5838314901); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb 0.3491902126 0.4845292045 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/srgb_linear.hrx b/spec/core_functions/color/to_space/srgb_linear/srgb_linear.hrx new file mode 100644 index 0000000000..8623ee99c6 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/srgb_linear.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), srgb-linear)} + +<===> in_range/output.css +a { + b: color(srgb-linear 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), srgb-linear)} + +<===> out_of_range/output.css +a { + b: color(srgb-linear -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/xyz.hrx b/spec/core_functions/color/to_space/srgb_linear/xyz.hrx new file mode 100644 index 0000000000..f18163e9bc --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9504559271 1 1.0890577508); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.4752279635 0.5 0.5445288754); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.3698965263 0.386349125 0.8119697975); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz 0.0916045133 0.2178130964 1.9294113977); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -412390.3868751602 -212638.7932325045 -19330.7993847731); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.1669001843 0.1859553309 0.3109316835 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.1669001843 0.1859553309 0.3109316835 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.1646914304 0.3089986016); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.0953833164 none 0.2870927275); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.1127559478 0.1642976363 none); +} diff --git a/spec/core_functions/color/to_space/srgb_linear/xyz_d50.hrx b/spec/core_functions/color/to_space/srgb_linear/xyz_d50.hrx new file mode 100644 index 0000000000..7472591f50 --- /dev/null +++ b/spec/core_functions/color/to_space/srgb_linear/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 0.9642956764 1 0.8251046025); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.4821478382 0.5 0.4125523013); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.3557364892 0.3797492885 0.6128967994); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 0.0041516969 0.1855012477 1.4531073219); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -436065.3108085225 -222492.9546173881 -13923.9075392479); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.1635604026 0.1838126633 0.235038464 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.1635604026 0.1838126633 0.235038464 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.1615633456 0.2336460719); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.0865301007 none 0.2156221992); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(srgb-linear 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.1206368766 0.1656267203 none); +} diff --git a/spec/core_functions/color/to_space/xyz/a98_rgb.hrx b/spec/core_functions/color/to_space/xyz/a98_rgb.hrx new file mode 100644 index 0000000000..02e9031c89 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/a98_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), a98-rgb)} + +<===> black/output.css +a { + b: color(a98-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), a98-rgb)} + +<===> white/output.css +a { + b: color(a98-rgb 1.0579328451 0.9761412908 0.9581457442); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), a98-rgb)} + +<===> gray/output.css +a { + b: color(a98-rgb 0.7719295678 0.7122496746 0.6991190732); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), a98-rgb)} + +<===> middle/output.css +a { + b: color(a98-rgb -0.3403753886 0.7865601683 0.8866254663); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), a98-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(a98-rgb -1.6372044815 1.3072981109 1.360980168); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), a98-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(a98-rgb -739.9221025629 527.3176861205 -75.3831765931); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), a98-rgb)} + +<===> alpha/partial/output.css +a { + b: color(a98-rgb -0.1351623531 0.5702285503 0.5625764827 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), a98-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(a98-rgb -0.1351623531 0.5702285503 0.5625764827 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), a98-rgb)} + +<===> missing/red/output.css +a { + b: color(a98-rgb none 0.6499288625 0.5613563103); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), a98-rgb)} + +<===> missing/green/output.css +a { + b: color(a98-rgb 0.3521663165 none 0.5835625865); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), a98-rgb)} + +<===> missing/blue/output.css +a { + b: color(a98-rgb 0.3365194536 0.5589776013 none); +} diff --git a/spec/core_functions/color/to_space/xyz/display_p3.hrx b/spec/core_functions/color/to_space/xyz/display_p3.hrx new file mode 100644 index 0000000000..b1383e9adc --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1.067061664 0.9807650127 0.9623860213); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.785596466 0.7209470243 0.7071783379); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 -0.4800324283 0.7723805169 0.8767615059); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -1.7588549225 1.2221230245 1.3074633625); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -488.1354653538 308.5645035738 -83.3006508571); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 -0.2665155311 0.5626429938 0.5614732822 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 -0.2665155311 0.5626429938 0.5614732822 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.6339496775 0.5581173728); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.3937592636 none 0.575458821); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.2785701294 0.5560005714 none); +} diff --git a/spec/core_functions/color/to_space/xyz/hsl.hrx b/spec/core_functions/color/to_space/xyz/hsl.hrx new file mode 100644 index 0000000000..03e8d0caaa --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(188.6326376323, 287.948753728%, 102.1970070346%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(8.6326376323, 19.0960524665%, 75.1815938992%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(183.9973689591, 600.9357681928%, 12.7508937669%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(0.951270101, 523.3395920082%, -31.8043324514%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(330.5196564153, 405.9398117154%, -10761.9459979264%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(179.5022543706, 556.250481638%, 8.7700702541%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(179.5022543706, 556.250481638%, 8.7700702541%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(355.8794204538, 2697.9214173204%, -2.5244914397%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(290.3526254976, 328.3439800543%, 14.0892871543%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(93.2964667331, 215.664278299%, 17.8710983929%); +} diff --git a/spec/core_functions/color/to_space/xyz/hwb.hrx b/spec/core_functions/color/to_space/xyz/hwb.hrx new file mode 100644 index 0000000000..c7c66e8f26 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz 1 1 1), hwb)); + +<===> white/output.css +a { + value: hsl(188.6326376323, 287.948753728%, 102.1970070346%); + space: hwb; + channels: 8.6326376323deg 95.8707526592% -8.5232614099% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(8.6326376323, 19.0960524665%, 75.1815938992%); + space: hwb; + channels: 8.6326376323deg 70.4422580488% 20.0790702505% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: hsl(183.9973689591, 600.9357681928%, 12.7508937669%); + space: hwb; + channels: 183.9973689591deg -63.8737876426% 10.6244248236% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(0.951270101, 523.3395920082%, -31.8043324514%); + space: hwb; + channels: 180.951270101deg -198.2489961434% -34.6403312406% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(330.5196564153, 405.9398117154%, -10761.9459979264%); + space: hwb; + channels: 150.5196564153deg -54448.9693188225% -32825.0773229696% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(179.5022543706, 556.250481638%, 8.7700702541%, 0.4); + space: hwb; + channels: 179.5022543706deg -40.0134877742% 42.4463717177% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(179.5022543706, 556.250481638%, 8.7700702541%, 0); + space: hwb; + channels: 179.5022543706deg -40.0134877742% 42.4463717177% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(355.8794204538, 2697.9214173204%, -2.5244914397%); + space: hwb; + channels: 175.8794204538deg -70.6332866707% 34.4156962088% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(290.3526254976, 328.3439800543%, 14.0892871543%); + space: hwb; + channels: 290.3526254976deg -32.1720390494% 39.6493866421% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(xyz 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(93.2964667331, 215.664278299%, 17.8710983929%); +} diff --git a/spec/core_functions/color/to_space/xyz/lab.hrx b/spec/core_functions/color/to_space/xyz/lab.hrx new file mode 100644 index 0000000000..f5d3c2eac5 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), lab)} + +<===> white/output.css +a { + b: color-mix(in lab, color(xyz 1 1 1) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(76.1608841835% 7.1944893389 4.6048603909); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(68.6381340629% -79.8035401529 -34.4873470111); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(64.3546378926% -4876.8569771732 -106.5787284462); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lab, color(xyz -999999 0 0.000000002) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(51.373608379% -60.0251143111 -14.0399860293 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(51.373608379% -60.0251143111 -14.0399860293 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(51.0322781723% -262.2343975897 -14.80446365); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: color-mix(in lab, color(xyz 0.1 0 0.3) 100%, black); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(51.9556818936% -50.8750926576 85.6399941916); +} diff --git a/spec/core_functions/color/to_space/xyz/lch.hrx b/spec/core_functions/color/to_space/xyz/lch.hrx new file mode 100644 index 0000000000..045fdeb008 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), lch)} + +<===> white/output.css +a { + b: color-mix(in lch, color(xyz 1 1 1) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(76.1608841835% 8.541979634 32.621430668deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(68.6381340629% 86.9366558179 203.3717362956deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(64.3546378926% 4878.0214227861 181.2519414622deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in lch, color(xyz -999998.9999993658 0.000000211 0.0000133413) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(51.373608379% 61.6452395223 193.1649108151deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(51.373608379% 61.6452395223 193.1649108151deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(51.0322781723% 262.6519587272 183.231207866deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: color-mix(in lch, color(xyz 0.1 0 0.3) 100%, black); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(51.9556818936% 99.6116642671 120.7127528375deg); +} diff --git a/spec/core_functions/color/to_space/xyz/oklab.hrx b/spec/core_functions/color/to_space/xyz/oklab.hrx new file mode 100644 index 0000000000..df59baac2a --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), oklab)} + +<===> white/output.css +a { + b: color-mix(in oklab, color(xyz 1 1 1) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(79.6276375075% 0.0212390424 0.011797917); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(70.8952946273% -0.2482574119 -0.0948731015); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(38.0019911648% -3.242940099 -0.3314216345); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -999998.9999999991 -0.0000000001 0) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(56.4079108835% -0.1736338918 -0.037500532 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(56.4079108835% -0.1736338918 -0.037500532 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(52.699430823% -0.4922232406 -0.0409679345); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(26.3423259569% 0.3682063514 -0.2704617545); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(56.6867659008% -0.1591393684 0.1508075586); +} diff --git a/spec/core_functions/color/to_space/xyz/oklch.hrx b/spec/core_functions/color/to_space/xyz/oklch.hrx new file mode 100644 index 0000000000..ffaa9d2570 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), oklch)} + +<===> white/output.css +a { + b: color-mix(in oklch, color(xyz 1 1 1) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(79.6276375075% 0.0242958385 29.0514068282deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(70.8952946273% 0.2657680341 200.9146648791deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(38.0019911648% 3.2598314045 185.8352487879deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -999998.9999999985 -0.0000000001 -0.0000000012) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(56.4079108835% 0.1776373223 192.1872495768deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(56.4079108835% 0.1776373223 192.1872495768deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(52.699430823% 0.4939251868 184.7577843583deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(26.3423259569% 0.4568648354 323.7012836228deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(56.6867659008% 0.2192447453 136.539820405deg); +} diff --git a/spec/core_functions/color/to_space/xyz/prophoto_rgb.hrx b/spec/core_functions/color/to_space/xyz/prophoto_rgb.hrx new file mode 100644 index 0000000000..a9ddb19964 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1.0429146548 0.9845782985 0.953747937); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.7095939166 0.6699021515 0.6489253277); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.2936039607 0.6811658686 0.8421802859); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -1.340921335 1.0822677288 1.4036262654); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -2600.5460588084 1508.1151466205 177.670007881); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.2194696613 0.4617099795 0.489000517 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.2194696613 0.4617099795 0.489000517 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.5136422936 0.49010255); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.2931451274 none 0.4853966387); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.2715690946 0.4564221473 none); +} diff --git a/spec/core_functions/color/to_space/xyz/rec2020.hrx b/spec/core_functions/color/to_space/xyz/rec2020.hrx new file mode 100644 index 0000000000..e5bf205acf --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1.0517415202 0.9828015442 0.9579473111); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.7433125628 0.6928455465 0.6746511829); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 -0.0073399546 0.7239127682 0.8607584595); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -1.5202475993 1.156770634 1.350426083); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -702.5226404146 458.9706861542 -89.4449238228); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.1079117715 0.501698873 0.516462928 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.1079117715 0.501698873 0.516462928 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.5663964614 0.5146878151); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.2830292386 none 0.5249837189); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.2916789955 0.496779191 none); +} diff --git a/spec/core_functions/color/to_space/xyz/rgb.hrx b/spec/core_functions/color/to_space/xyz/rgb.hrx new file mode 100644 index 0000000000..42e00afb20 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), rgb)} + +<===> white/output.css +a { + b: hsl(188.6326376323, 287.948753728%, 102.1970070346%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(203.7983708613, 183.1053603906, 179.6277580244); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: hsl(183.9973689591, 600.9357681928%, 12.7508937669%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(0.951270101, 523.3395920082%, -31.8043324514%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(330.5196564153, 405.9398117154%, -10761.9459979264%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(179.5022543706, 556.250481638%, 8.7700702541%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(179.5022543706, 556.250481638%, 8.7700702541%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 167.2399746676, 143.3849194416); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: rgb(115.9585352591, 0, 153.8940640627); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: rgb(34.7719641116, 143.8523181031, 0); +} diff --git a/spec/core_functions/color/to_space/xyz/srgb.hrx b/spec/core_functions/color/to_space/xyz/srgb.hrx new file mode 100644 index 0000000000..fd66c826de --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), srgb)} + +<===> white/output.css +a { + b: color(srgb 1.0852326141 0.9769116138 0.9587075266); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.7992092975 0.7180602368 0.7044225805); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), srgb)} + +<===> middle/output.css +a { + b: color(srgb -0.6387378764 0.7916567108 0.8937557518); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1.9824899614 1.2936253684 1.3464033124); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -544.4896931882 329.2507732297 -100.0520460013); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb -0.4001348777 0.5755362828 0.5674423486 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb -0.4001348777 0.5755362828 0.5674423486 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.6558430379 0.5622938017); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.454739354 none 0.6035061336); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb 0.1363606436 0.5641267377 none); +} diff --git a/spec/core_functions/color/to_space/xyz/srgb_linear.hrx b/spec/core_functions/color/to_space/xyz/srgb_linear.hrx new file mode 100644 index 0000000000..db67b30a28 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1.204976004 0.9482789226 0.9086246351); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.602488002 0.4741394613 0.4543123175); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear -0.3656478909 0.5897823193 0.7751124438); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -4.8531447335 1.8027407517 1.9767221652); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -3240966.700934579 969242.6670372436 -55630.0240669139); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear -0.1329628694 0.2907356539 0.2818590705 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear -0.1329628694 0.2907356539 0.2818590705 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.3876600175 0.2762960625); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.1745137661 none 0.3226544622); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear 0.0166203587 0.2782691367 none); +} diff --git a/spec/core_functions/color/to_space/xyz/xyz.hrx b/spec/core_functions/color/to_space/xyz/xyz.hrx new file mode 100644 index 0000000000..6a7a854801 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/xyz.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), xyz)} + +<===> in_range/output.css +a { + b: color(xyz 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), xyz)} + +<===> out_of_range/output.css +a { + b: color(xyz -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/xyz/xyz_d50.hrx b/spec/core_functions/color/to_space/xyz/xyz_d50.hrx new file mode 100644 index 0000000000..546f8d7e32 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 1.0206843969 1.0029884365 0.7576864323); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.5103421984 0.5014942182 0.3788432161); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.1786108937 0.3884402932 0.6056728936); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 -1.1391355769 0.3323983638 1.5190136801); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -1047928.744615204 -29627.7791422469 9243.0314031639); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.0943246735 0.1959275265 0.2276490187 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.0943246735 0.1959275265 0.2276490187 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.1929647456 0.2285733227); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.0897352994 none 0.2246379804); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.1093823534 0.2010496662 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/a98_rgb.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/a98_rgb.hrx new file mode 100644 index 0000000000..1d17f2ff98 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/a98_rgb.hrx @@ -0,0 +1,52 @@ +<===> in_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), xyz-d50)} + +<===> in_range/output.css +a { + b: color(xyz-d50 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), xyz-d50)} + +<===> out_of_range/output.css +a { + b: color(xyz-d50 -1 0.4 2); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.1 0.2 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/display_p3.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/display_p3.hrx new file mode 100644 index 0000000000..d8e16a972c --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/display_p3.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), display-p3)} + +<===> black/output.css +a { + b: color(display-p3 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), display-p3)} + +<===> white/output.css +a { + b: color(display-p3 1.0071270999 0.9879174398 1.092886631); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), display-p3)} + +<===> gray/output.css +a { + b: color(display-p3 0.7406962751 0.7263052903 0.8049433314); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), display-p3)} + +<===> middle/output.css +a { + b: color(display-p3 -0.520302433 0.7760128678 0.9954240218); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), display-p3)} + +<===> out_of_range/near/output.css +a { + b: color(display-p3 -1.7430526394 1.2261981059 1.4801698042); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), display-p3)} + +<===> out_of_range/far/output.css +a { + b: color(display-p3 -480.7511485906 310.5370514577 -94.2421709039); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), display-p3)} + +<===> alpha/partial/output.css +a { + b: color(display-p3 -0.3072826123 0.5660777225 0.6401555397 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), display-p3)} + +<===> alpha/transparent/output.css +a { + b: color(display-p3 -0.3072826123 0.5660777225 0.6401555397 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), display-p3)} + +<===> missing/red/output.css +a { + b: color(display-p3 none 0.637912978 0.6363418884); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), display-p3)} + +<===> missing/green/output.css +a { + b: color(display-p3 0.3827670965 none 0.655277932); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), display-p3)} + +<===> missing/blue/output.css +a { + b: color(display-p3 0.2276620199 0.5616123537 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/hsl.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/hsl.hrx new file mode 100644 index 0000000000..765a1743e2 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/hsl.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), hsl)} + +<===> black/output.css +a { + b: hsl(0, 0%, 0%); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), hsl)} + +<===> white/output.css +a { + b: hsl(72.6622302958, 128.9066481357%, 104.4631089642%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), hsl)} + +<===> gray/output.css +a { + b: hsl(252.6622302958, 18.6415390171%, 76.8792521782%); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), hsl)} + +<===> middle/output.css +a { + b: hsl(187.9353554297, 490.1229331153%, 17.2918334784%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), hsl)} + +<===> out_of_range/near/output.css +a { + b: hsl(3.9698519642, 796.3834139233%, -21.9385057601%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), hsl)} + +<===> out_of_range/far/output.css +a { + b: hsl(329.431996419, 420.4439814741%, -10316.9080915762%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), hsl)} + +<===> alpha/partial/output.css +a { + b: hsla(184.0103843189, 495.2078632431%, 10.9589006248%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), hsl)} + +<===> alpha/transparent/output.css +a { + b: hsla(184.0103843189, 495.2078632431%, 10.9589006248%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), hsl)} + +<===> missing/red/output.css +a { + b: hsl(359.4153454139, 2475.3715741602%, -2.7790249918%); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), hsl)} + +<===> missing/green/output.css +a { + b: hsl(285.6927471827, 282.9980963007%, 17.9207568387%); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), hsl)} + +<===> missing/blue/output.css +a { + b: hsl(111.1172729557, 222.5792269318%, 17.6906141138%); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/hwb.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/hwb.hrx new file mode 100644 index 0000000000..bc1c5198a9 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/hwb.hrx @@ -0,0 +1,149 @@ +<===> black/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 0 0 0), hwb)); + +<===> black/output.css +a { + value: black; + space: hwb; + channels: 0deg 0% 100% / 1; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 1 1 1), hwb)); + +<===> white/output.css +a { + value: hsl(72.6622302958, 128.9066481357%, 104.4631089642%); + space: hwb; + channels: 252.6622302958deg 98.7098647958% -10.2163531326% / 1; +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 0.5 0.5 0.5), hwb)); + +<===> gray/output.css +a { + value: hsl(252.6622302958, 18.6415390171%, 76.8792521782%); + space: hwb; + channels: 252.6622302958deg 72.569188952% 18.8106845955% / 1; +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 0.2 0.4 0.8), hwb)); + +<===> middle/output.css +a { + value: hsl(187.9353554297, 490.1229331153%, 17.2918334784%); + space: hwb; + channels: 187.9353554297deg -67.4594079552% -2.043074912% / 1; +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 -1 0.4 2), hwb)); + +<===> out_of_range/near/output.css +a { + value: hsl(3.9698519642, 796.3834139233%, -21.9385057601%); + space: hwb; + channels: 183.9698519642deg -196.6531268961% -52.7761153759% / 1; +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 -999999 0 0), hwb)); + +<===> out_of_range/far/output.css +a { + value: hsl(329.431996419, 420.4439814741%, -10316.9080915763%); + space: hwb; + channels: 149.431996419deg -53693.7272368212% -32959.9110536687% / 1; +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), hwb)); + +<===> alpha/partial/output.css +a { + value: hsla(184.0103843189, 495.2078632431%, 10.9589006248%, 0.4); + space: hwb; + channels: 184.0103843189deg -43.310436994% 34.7717617565% / 0.4; +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), hwb)); + +<===> alpha/transparent/output.css +a { + value: hsla(184.0103843189, 495.2078632431%, 10.9589006248%, 0); + space: hwb; + channels: 184.0103843189deg -43.310436994% 34.7717617565% / 0; +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 none 0.2 0.3), hwb)); + +<===> missing/red/output.css +a { + value: hsl(359.4153454139, 2475.3715741602%, -2.7790249918%); + space: hwb; + channels: 179.4153454139deg -71.5702196777% 33.9878303059% / 1; +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +@include utils.inspect(color.to-space(color(xyz-d50 0.1 none 0.3), hwb)); + +<===> missing/green/output.css +a { + value: hsl(285.6927471827, 282.9980963007%, 17.9207568387%); + space: hwb; + channels: 285.6927471827deg -32.7946438576% 31.363842465% / 1; +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +@use 'core_functions/color/utils'; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), hwb)} + +<===> missing/blue/output.css +a { + b: hsl(111.1172729557, 222.5792269318%, 17.6906141138%); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/lab.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/lab.hrx new file mode 100644 index 0000000000..a1fa3265e5 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/lab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), lab)} + +<===> black/output.css +a { + b: lab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), lab)} + +<===> white/output.css +a { + b: lab(100% 6.096419139 -13.2359011077); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), lab)} + +<===> gray/output.css +a { + b: lab(76.0692610142% 4.8387310772 -10.505341671); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), lab)} + +<===> middle/output.css +a { + b: lab(69.4695307685% -72.4361685024 -50.5894155557); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), lab)} + +<===> out_of_range/near/output.css +a { + b: lab(69.4695307685% -4337.1188269787 -121.2991404532); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), lab)} + +<===> out_of_range/far/output.css +a { + b: lab(0% -4037677156.674863 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), lab)} + +<===> alpha/partial/output.css +a { + b: lab(51.8372115265% -57.4926250406 -25.7864288134 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), lab)} + +<===> alpha/transparent/output.css +a { + b: lab(51.8372115265% -57.4926250406 -25.7864288134 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), lab)} + +<===> missing/red/output.css +a { + b: lab(51.8372115265% -223.4362565799 -25.7864288134); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), lab)} + +<===> missing/green/output.css +a { + b: lab(0% 165.9436315393 -115.1609314454); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), lab)} + +<===> missing/blue/output.css +a { + b: lab(51.8372115265% -57.4926250406 89.374502632); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/lch.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/lch.hrx new file mode 100644 index 0000000000..77da948878 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/lch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), lch)} + +<===> black/output.css +a { + b: lch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), lch)} + +<===> white/output.css +a { + b: lch(100% 14.5724193067 294.7306655583deg); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), lch)} + +<===> gray/output.css +a { + b: lch(76.0692610142% 11.5661368686 294.7306655583deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), lch)} + +<===> middle/output.css +a { + b: lch(69.4695307685% 88.3531973025 214.9304458642deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), lch)} + +<===> out_of_range/near/output.css +a { + b: lch(69.4695307685% 4338.814723033 181.6020122751deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), lch)} + +<===> out_of_range/far/output.css +a { + b: lch(0% 4037677156.674863 180deg); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), lch)} + +<===> alpha/partial/output.css +a { + b: lch(51.8372115265% 63.0106486636 204.1570528501deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), lch)} + +<===> alpha/transparent/output.css +a { + b: lch(51.8372115265% 63.0106486636 204.1570528501deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), lch)} + +<===> missing/red/output.css +a { + b: lch(51.8372115265% 224.9193203471 186.5832915139deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), lch)} + +<===> missing/green/output.css +a { + b: lch(0% 201.988437738 325.2402722247deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), lch)} + +<===> missing/blue/output.css +a { + b: lch(51.8372115265% 106.2694860003 122.7522732424deg); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/oklab.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/oklab.hrx new file mode 100644 index 0000000000..3faba56ba4 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/oklab.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), oklab)} + +<===> black/output.css +a { + b: oklab(0% 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), oklab)} + +<===> white/output.css +a { + b: color-mix(in oklab, color(xyz 0.9956342097 1.0026671299 1.3221722918) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), oklab)} + +<===> gray/output.css +a { + b: oklab(79.6577658839% 0.0133226724 -0.0281100387); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), oklab)} + +<===> middle/output.css +a { + b: oklab(71.9979200541% -0.2538804764 -0.1411846084); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), oklab)} + +<===> out_of_range/near/output.css +a { + b: oklab(42.8855772157% -3.2722752803 -0.3756610558); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), oklab)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklab, color(xyz -955472.4660146529 28369.6809641542 -12314.0025504671) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), oklab)} + +<===> alpha/partial/output.css +a { + b: oklab(56.9970926622% -0.1786682028 -0.0706832596 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), oklab)} + +<===> alpha/transparent/output.css +a { + b: oklab(56.9970926622% -0.1786682028 -0.0706832596 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), oklab)} + +<===> missing/red/output.css +a { + b: oklab(53.737032336% -0.4814823965 -0.0723240631); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), oklab)} + +<===> missing/green/output.css +a { + b: oklab(29.1994683846% 0.3079984165 -0.2894921466); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), oklab)} + +<===> missing/blue/output.css +a { + b: oklab(56.4114760121% -0.1759135151 0.1541840121); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/oklch.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/oklch.hrx new file mode 100644 index 0000000000..23bf2d569f --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/oklch.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), oklch)} + +<===> black/output.css +a { + b: oklch(0% 0 none); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), oklch)} + +<===> white/output.css +a { + b: color-mix(in oklch, color(xyz 0.9956342097 1.0026671299 1.3221722918) 100%, black); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), oklch)} + +<===> gray/output.css +a { + b: oklch(79.6577658839% 0.0311073605 295.3584786053deg); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), oklch)} + +<===> middle/output.css +a { + b: oklch(71.9979200541% 0.2904967986 209.0787246058deg); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), oklch)} + +<===> out_of_range/near/output.css +a { + b: oklch(42.8855772157% 3.2937678635 186.548953155deg); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), oklch)} + +<===> out_of_range/far/output.css +a { + b: color-mix(in oklch, color(xyz -955472.4660146533 28369.6809641542 -12314.0025504659) 100%, black); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), oklch)} + +<===> alpha/partial/output.css +a { + b: oklch(56.9970926622% 0.1921417442 201.5843389185deg / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), oklch)} + +<===> alpha/transparent/output.css +a { + b: oklch(56.9970926622% 0.1921417442 201.5843389185deg / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), oklch)} + +<===> missing/red/output.css +a { + b: oklch(53.737032336% 0.4868840398 188.5426015282deg); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), oklch)} + +<===> missing/green/output.css +a { + b: oklch(29.1994683846% 0.4226922374 316.7740736717deg); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), oklch)} + +<===> missing/blue/output.css +a { + b: oklch(56.4114760121% 0.2339193759 138.7662056048deg); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/prophoto_rgb.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/prophoto_rgb.hrx new file mode 100644 index 0000000000..f8b526bba7 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/prophoto_rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), prophoto-rgb)} + +<===> black/output.css +a { + b: color(prophoto-rgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), prophoto-rgb)} + +<===> white/output.css +a { + b: color(prophoto-rgb 1.0215440123 0.9911601047 1.1127148486); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), prophoto-rgb)} + +<===> gray/output.css +a { + b: color(prophoto-rgb 0.6950534384 0.6743803795 0.7570856195); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), prophoto-rgb)} + +<===> middle/output.css +a { + b: color(prophoto-rgb 0.3164433223 0.688517143 0.9829806921); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), prophoto-rgb)} + +<===> out_of_range/near/output.css +a { + b: color(prophoto-rgb -1.2757747112 1.1009423845 1.6353953931); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), prophoto-rgb)} + +<===> out_of_range/far/output.css +a { + b: color(prophoto-rgb -2540.8942289653 1537.1744596752 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), prophoto-rgb)} + +<===> alpha/partial/output.css +a { + b: color(prophoto-rgb 0.2248370109 0.4663680632 0.5700273474 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), prophoto-rgb)} + +<===> alpha/transparent/output.css +a { + b: color(prophoto-rgb 0.2248370109 0.4663680632 0.5700273474 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), prophoto-rgb)} + +<===> missing/red/output.css +a { + b: color(prophoto-rgb none 0.5196499466 0.5700273474); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), prophoto-rgb)} + +<===> missing/green/output.css +a { + b: color(prophoto-rgb 0.3068439327 none 0.5700273474); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), prophoto-rgb)} + +<===> missing/blue/output.css +a { + b: color(prophoto-rgb 0.251671286 0.4600356682 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/rec2020.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/rec2020.hrx new file mode 100644 index 0000000000..ba37d1791d --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/rec2020.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), rec2020)} + +<===> black/output.css +a { + b: color(rec2020 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), rec2020)} + +<===> white/output.css +a { + b: color(rec2020 1.0086369229 0.9889840495 1.1030370326); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), rec2020)} + +<===> gray/output.css +a { + b: color(rec2020 0.7117581507 0.6973714052 0.7808630758); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), rec2020)} + +<===> middle/output.css +a { + b: color(rec2020 -0.075615701 0.7287813238 0.9918551161); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), rec2020)} + +<===> out_of_range/near/output.css +a { + b: color(rec2020 -1.4925160884 1.1662135588 1.5466705118); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), rec2020)} + +<===> out_of_range/far/output.css +a { + b: color(rec2020 -689.5826182995 463.8899975273 -113.049587293); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), rec2020)} + +<===> alpha/partial/output.css +a { + b: color(rec2020 0.0683739868 0.5055777091 0.6004180325 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), rec2020)} + +<===> alpha/transparent/output.css +a { + b: color(rec2020 0.0683739868 0.5055777091 0.6004180325 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), rec2020)} + +<===> missing/red/output.css +a { + b: color(rec2020 none 0.57127065 0.5978630317); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), rec2020)} + +<===> missing/green/output.css +a { + b: color(rec2020 0.2799117622 none 0.6111315018); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), rec2020)} + +<===> missing/blue/output.css +a { + b: color(rec2020 0.2651201665 0.5016141545 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/rgb.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/rgb.hrx new file mode 100644 index 0000000000..7891d1ae7d --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/rgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), rgb)} + +<===> black/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), rgb)} + +<===> white/output.css +a { + b: hsl(72.6622302958, 128.9066481357%, 104.4631089642%); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), rgb)} + +<===> gray/output.css +a { + b: rgb(189.6903079461, 185.0514318275, 207.0327542814); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), rgb)} + +<===> middle/output.css +a { + b: hsl(187.9353554297, 490.1229331153%, 17.2918334784%); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), rgb)} + +<===> out_of_range/near/output.css +a { + b: hsl(3.9698519642, 796.3834139233%, -21.9385057601%); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), rgb)} + +<===> out_of_range/far/output.css +a { + b: hsl(329.431996419, 420.4439814741%, -10316.9080915762%); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), rgb)} + +<===> alpha/partial/output.css +a { + b: hsla(184.0103843189, 495.2078632431%, 10.9589006248%, 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), rgb)} + +<===> alpha/transparent/output.css +a { + b: hsla(184.0103843189, 495.2078632431%, 10.9589006248%, 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), rgb)} + +<===> missing/red/output.css +a { + b: rgb(0, 168.3310327198, 164.9124102862); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), rgb)} + +<===> missing/green/output.css +a { + b: rgb(113.3463666573, 0, 175.0222017144); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), rgb)} + +<===> missing/blue/output.css +a { + b: hsl(128.9663541465, 142.6286256266%, 23.5199973212%); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/srgb.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/srgb.hrx new file mode 100644 index 0000000000..65f2132f29 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/srgb.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), srgb)} + +<===> black/output.css +a { + b: color(srgb 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), srgb)} + +<===> white/output.css +a { + b: color(srgb 1.0113816155 0.987098648 1.1021635313); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), srgb)} + +<===> gray/output.css +a { + b: color(srgb 0.7438835606 0.7256918895 0.811893154); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), srgb)} + +<===> middle/output.css +a { + b: color(srgb -0.6745940796 0.7962536745 1.0204307491); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), srgb)} + +<===> out_of_range/near/output.css +a { + b: color(srgb -1.966531269 1.2965640931 1.5277611538); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), srgb)} + +<===> out_of_range/far/output.css +a { + b: color(srgb -536.9372723682 330.5991105367 -111.3818104512); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), srgb)} + +<===> alpha/partial/output.css +a { + b: color(srgb -0.4331043699 0.5797354156 0.6522823824 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), srgb)} + +<===> alpha/transparent/output.css +a { + b: color(srgb -0.4331043699 0.5797354156 0.6522823824 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), srgb)} + +<===> missing/red/output.css +a { + b: color(srgb none 0.6601216969 0.6467153345); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), srgb)} + +<===> missing/green/output.css +a { + b: color(srgb 0.4444955555 none 0.6863615754); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), srgb)} + +<===> missing/blue/output.css +a { + b: color(srgb -0.1002625161 0.5706624625 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/srgb_linear.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/srgb_linear.hrx new file mode 100644 index 0000000000..2a9fac3211 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/srgb_linear.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), srgb-linear)} + +<===> black/output.css +a { + b: color(srgb-linear 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), srgb-linear)} + +<===> white/output.css +a { + b: color(srgb-linear 1.026087637 0.9709017742 1.2483646679); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), srgb-linear)} + +<===> gray/output.css +a { + b: color(srgb-linear 0.5130438185 0.4854508871 0.6241823339); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), srgb-linear)} + +<===> middle/output.css +a { + b: color(srgb-linear -0.412657003 0.5974969544 1.0471092027); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), srgb-linear)} + +<===> out_of_range/near/output.css +a { + b: color(srgb-linear -4.7624146879 1.8121829743 2.6472259737); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), srgb-linear)} + +<===> out_of_range/far/output.css +a { + b: color(srgb-linear -3134132.718764265 978794.4977603011 -71955.3206025548); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), srgb-linear)} + +<===> alpha/partial/output.css +a { + b: color(srgb-linear -0.1572622797 0.2954041898 0.3830159978 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), srgb-linear)} + +<===> alpha/transparent/output.css +a { + b: color(srgb-linear -0.1572622797 0.2954041898 0.3830159978 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), srgb-linear)} + +<===> missing/red/output.css +a { + b: color(srgb-linear none 0.3932837375 0.3758204586); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), srgb-linear)} + +<===> missing/green/output.css +a { + b: color(srgb-linear 0.1662149199 none 0.4288113498); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), srgb-linear)} + +<===> missing/blue/output.css +a { + b: color(srgb-linear -0.0100636143 0.2853713278 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/xyz.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/xyz.hrx new file mode 100644 index 0000000000..45628af2d4 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/xyz.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), xyz)} + +<===> black/output.css +a { + b: color(xyz 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), xyz)} + +<===> white/output.css +a { + b: color(xyz 0.9956342097 1.0026671299 1.3221722918); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), xyz)} + +<===> gray/output.css +a { + b: color(xyz 0.4978171049 0.501333565 0.6610861459); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), xyz)} + +<===> middle/output.css +a { + b: color(xyz 0.2324626969 0.4151573703 1.0585524842); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), xyz)} + +<===> out_of_range/near/output.css +a { + b: color(xyz -0.8381943171 0.474450751 2.6402147779); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), xyz)} + +<===> out_of_range/far/output.css +a { + b: color(xyz -955472.4660146538 28369.6809641542 -12314.0025504671); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), xyz)} + +<===> alpha/partial/output.css +a { + b: color(xyz 0.1099054241 0.205474541 0.3962396495 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), xyz)} + +<===> alpha/transparent/output.css +a { + b: color(xyz 0.1099054241 0.205474541 0.3962396495 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), xyz)} + +<===> missing/red/output.css +a { + b: color(xyz none 0.208311512 0.395008248); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), xyz)} + +<===> missing/green/output.css +a { + b: color(xyz 0.1145251151 none 0.4003411794); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), xyz)} + +<===> missing/blue/output.css +a { + b: color(xyz 0.0909276512 0.1991621087 none); +} diff --git a/spec/core_functions/color/to_space/xyz_d50/xyz-d50/xyz_d50.hrx b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/xyz_d50.hrx new file mode 100644 index 0000000000..c29ed37099 --- /dev/null +++ b/spec/core_functions/color/to_space/xyz_d50/xyz-d50/xyz_d50.hrx @@ -0,0 +1,118 @@ +<===> black/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0 0 0), xyz-d50)} + +<===> black/output.css +a { + b: color(xyz-d50 0 0 0); +} + +<===> +================================================================================ +<===> white/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 1 1 1), xyz-d50)} + +<===> white/output.css +a { + b: color(xyz-d50 1 1 1); +} + +<===> +================================================================================ +<===> gray/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.5 0.5 0.5), xyz-d50)} + +<===> gray/output.css +a { + b: color(xyz-d50 0.5 0.5 0.5); +} + +<===> +================================================================================ +<===> middle/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.2 0.4 0.8), xyz-d50)} + +<===> middle/output.css +a { + b: color(xyz-d50 0.2 0.4 0.8); +} + +<===> +================================================================================ +<===> out_of_range/near/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -1 0.4 2), xyz-d50)} + +<===> out_of_range/near/output.css +a { + b: color(xyz-d50 -1 0.4 2); +} + +<===> +================================================================================ +<===> out_of_range/far/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 -999999 0 0), xyz-d50)} + +<===> out_of_range/far/output.css +a { + b: color(xyz-d50 -999999 0 0); +} + +<===> +================================================================================ +<===> alpha/partial/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.4), xyz-d50)} + +<===> alpha/partial/output.css +a { + b: color(xyz-d50 0.1 0.2 0.3 / 0.4); +} + +<===> +================================================================================ +<===> alpha/transparent/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 0.3 / 0.0), xyz-d50)} + +<===> alpha/transparent/output.css +a { + b: color(xyz-d50 0.1 0.2 0.3 / 0); +} + +<===> +================================================================================ +<===> missing/red/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 none 0.2 0.3), xyz-d50)} + +<===> missing/red/output.css +a { + b: color(xyz-d50 none 0.2 0.3); +} + +<===> +================================================================================ +<===> missing/green/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 none 0.3), xyz-d50)} + +<===> missing/green/output.css +a { + b: color(xyz-d50 0.1 none 0.3); +} + +<===> +================================================================================ +<===> missing/blue/input.scss +@use "sass:color"; +a {b: color.to-space(color(xyz-d50 0.1 0.2 none), xyz-d50)} + +<===> missing/blue/output.css +a { + b: color(xyz-d50 0.1 0.2 none); +} diff --git a/spec/core_functions/color/whiteness.hrx b/spec/core_functions/color/whiteness.hrx index a92bc423b5..63bfe24a21 100644 --- a/spec/core_functions/color/whiteness.hrx +++ b/spec/core_functions/color/whiteness.hrx @@ -1,5 +1,5 @@ <===> max/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(white)} <===> max/output.css @@ -7,10 +7,23 @@ a { b: 100%; } +<===> max/warning +DEPRECATION WARNING: color.whiteness() is deprecated. Suggestion: + +color.channel($color, whiteness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.whiteness(white)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> min/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(black)} <===> min/output.css @@ -18,65 +31,143 @@ a { b: 0%; } +<===> min/warning +DEPRECATION WARNING: color.whiteness() is deprecated. Suggestion: + +color.channel($color, whiteness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.whiteness(black)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/zero_blackness/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(color.hwb(0, 50%, 0%))} <===> middle/zero_blackness/output.css a { - b: 50.1960784314%; + b: 50%; } +<===> middle/zero_blackness/warning +DEPRECATION WARNING: color.whiteness() is deprecated. Suggestion: + +color.channel($color, whiteness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.whiteness(color.hwb(0, 50%, 0%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/half_blackness/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(color.hwb(0, 50%, 50%))} <===> middle/half_blackness/output.css a { - b: 50.1960784314%; + b: 50%; } +<===> middle/half_blackness/warning +DEPRECATION WARNING: color.whiteness() is deprecated. Suggestion: + +color.channel($color, whiteness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.whiteness(color.hwb(0, 50%, 50%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> middle/high_blackness/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(color.hwb(0, 70%, 70%))} <===> middle/high_blackness/output.css a { - b: 50.1960784314%; + b: 50%; } +<===> middle/high_blackness/warning +DEPRECATION WARNING: color.whiteness() is deprecated. Suggestion: + +color.channel($color, whiteness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.whiteness(color.hwb(0, 70%, 70%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> fraction/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(color.hwb(0, 0.5%, 0%))} <===> fraction/output.css a { - b: 0.3921568627%; + b: 0.5%; } +<===> fraction/warning +DEPRECATION WARNING: color.whiteness() is deprecated. Suggestion: + +color.channel($color, whiteness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.whiteness(color.hwb(0, 0.5%, 0%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> named/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness($color: color.hwb(0, 42%, 0%))} <===> named/output.css a { - b: 41.9607843137%; + b: 42%; } +<===> named/warning +DEPRECATION WARNING: color.whiteness() is deprecated. Suggestion: + +color.channel($color, whiteness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.whiteness($color: color.hwb(0, 42%, 0%))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness()} <===> error/too_few_args/error @@ -94,7 +185,7 @@ Error: Missing argument $color. <===> ================================================================================ <===> error/too_many_args/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(red, green)} <===> error/too_many_args/error @@ -112,7 +203,7 @@ Error: Only 1 argument allowed, but 2 were passed. <===> ================================================================================ <===> error/type/input.scss -@use 'sass:color'; +@use "sass:color"; a {b: color.whiteness(1)} <===> error/type/error @@ -122,3 +213,17 @@ Error: $color: 1 is not a color. | ^^^^^^^^^^^^^^^^^^ ' input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/non_legacy/input.scss +@use "sass:color"; +a {b: color.whiteness(color(srgb 1 1 1))} + +<===> error/non_legacy/error +Error: color.whiteness() is only supported for legacy colors. Please use color.channel() instead with an explicit $space argument. + , +2 | a {b: color.whiteness(color(srgb 1 1 1))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/global/color.hrx b/spec/core_functions/global/color.hrx deleted file mode 100644 index 435f04fe23..0000000000 --- a/spec/core_functions/global/color.hrx +++ /dev/null @@ -1,389 +0,0 @@ -<===> red/input.scss -a {b: red(#abcdef)} - -<===> red/output.css -a { - b: 171; -} - -<===> -================================================================================ -<===> green/input.scss -a {b: green(#abcdef)} - -<===> green/output.css -a { - b: 205; -} - -<===> -================================================================================ -<===> blue/input.scss -a {b: blue(#abcdef)} - -<===> blue/output.css -a { - b: 239; -} - -<===> -================================================================================ -<===> hue/input.scss -a {b: hue(#abcdef)} - -<===> hue/output.css -a { - b: 210deg; -} - -<===> -================================================================================ -<===> saturation/input.scss -a {b: saturation(#abcdef)} - -<===> saturation/output.css -a { - b: 68%; -} - -<===> -================================================================================ -<===> lightness/input.scss -a {b: lightness(#abcdef)} - -<===> lightness/output.css -a { - b: 80.3921568627%; -} - -<===> -================================================================================ -<===> mix/input.scss -a {b: mix(#abcdef, #daddee)} - -<===> mix/output.css -a { - b: #c3d5ef; -} - -<===> -================================================================================ -<===> complement/input.scss -a {b: complement(#abcdef)} - -<===> complement/output.css -a { - b: #efcdab; -} - -<===> -================================================================================ -<===> darken/input.scss -a {b: darken(#abcdef, 10%)} - -<===> darken/output.css -a { - b: #80b4e7; -} - -<===> -================================================================================ -<===> desaturate/input.scss -a {b: desaturate(#abcdef, 10%)} - -<===> desaturate/output.css -a { - b: #b0cdea; -} - -<===> -================================================================================ -<===> fade-in/input.scss -a {b: fade-in(rgba(red, 0.5), 0.3)} - -<===> fade-in/output.css -a { - b: rgba(255, 0, 0, 0.8); -} - - -<===> -================================================================================ -<===> opacify/input.scss -a {b: opacify(rgba(red, 0.5), 0.3)} - -<===> opacify/output.css -a { - b: rgba(255, 0, 0, 0.8); -} - -<===> -================================================================================ -<===> fade-out/input.scss -a {b: fade-out(rgba(red, 0.5), 0.3)} - -<===> fade-out/output.css -a { - b: rgba(255, 0, 0, 0.2); -} - -<===> -================================================================================ -<===> transparentize/input.scss -a {b: transparentize(rgba(red, 0.5), 0.3)} - -<===> transparentize/output.css -a { - b: rgba(255, 0, 0, 0.2); -} - -<===> -================================================================================ -<===> lighten/input.scss -a {b: lighten(#abcdef, 10%)} - -<===> lighten/output.css -a { - b: #d6e7f7; -} - -<===> -================================================================================ -<===> saturate/input.scss -a {b: saturate(#abcdef, 10%)} - -<===> saturate/output.css -a { - b: #a6cdf4; -} - -<===> -================================================================================ -<===> alpha/input.scss -a {b: alpha(#abcdef)} - -<===> alpha/output.css -a { - b: 1; -} - -<===> -================================================================================ -<===> opacity/input.scss -a {b: opacity(#abcdef)} - -<===> opacity/output.css -a { - b: 1; -} - -<===> -================================================================================ -<===> scale/input.scss -a {b: scale-color(#abcdef, $red: 10%)} - -<===> scale/output.css -a { - b: #b3cdef; -} - -<===> -================================================================================ -<===> change/input.scss -a {b: change-color(#abcdef, $red: 10)} - -<===> change/output.css -a { - b: #0acdef; -} - -<===> -================================================================================ -<===> ie_hex_str/input.scss -a {b: ie-hex-str(#abcdef)} - -<===> ie_hex_str/output.css -a { - b: #FFABCDEF; -} - -<===> -================================================================================ -<===> grayscale/with_color/input.scss -a {b: grayscale(red)} - -<===> grayscale/with_color/output.css -a { - b: gray; -} - -<===> -================================================================================ -<===> grayscale/with_number/input.scss -// A number should produce a plain function string, for CSS filter functions. -a {b: grayscale(15%)} - -<===> grayscale/with_number/output.css -a { - b: grayscale(15%); -} - -<===> -================================================================================ -<===> grayscale/with_css_var/input.scss -a {b: grayscale(var(--c))} - -<===> grayscale/with_css_var/output.css -a { - b: grayscale(var(--c)); -} - -<===> -================================================================================ -<===> grayscale/with_calc/input.scss -a {b: grayscale(calc(1 + 2))} - -<===> grayscale/with_calc/output.css -a { - b: grayscale(3); -} - -<===> -================================================================================ -<===> grayscale/with_unquoted_calc/input.scss -@use "sass:string"; -a {b: grayscale(string.unquote('calc(1)'))} - -<===> grayscale/with_unquoted_calc/output.css -a { - b: grayscale(calc(1)); -} - -<===> -================================================================================ -<===> invert/with_color/input.scss -a {b: invert(#abcdef)} - -<===> invert/with_color/output.css -a { - b: #543210; -} - -<===> -================================================================================ -<===> invert/with_number/input.scss -a {b: invert(10%)} - -<===> invert/with_number/output.css -a { - b: invert(10%); -} - -<===> -================================================================================ -<===> invert/with_css_var/input.scss -a {b: invert(var(--c))} - -<===> invert/with_css_var/output.css -a { - b: invert(var(--c)); -} - -<===> -================================================================================ -<===> invert/with_calc/input.scss -a {b: invert(calc(1 + 2))} - -<===> invert/with_calc/output.css -a { - b: invert(3); -} - -<===> -================================================================================ -<===> invert/with_unquoted_calc/input.scss -@use "sass:string"; -a {b: invert(string.unquote('calc(1)'))} - -<===> invert/with_unquoted_calc/output.css -a { - b: invert(calc(1)); -} - -<===> -================================================================================ -<===> error/too_low/lighten/input.scss -a {b: lighten(red, -0.001)} - -<===> error/too_low/lighten/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: lighten(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_low/darken/input.scss -a {b: darken(red, -0.001)} - -<===> error/too_low/darken/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: darken(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_low/saturate/input.scss -a {b: saturate(red, -0.001)} - -<===> error/too_low/saturate/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: saturate(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_low/desaturate/input.scss -a {b: desaturate(red, -0.001)} - -<===> error/too_low/desaturate/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: desaturate(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_low/fade_in/input.scss -a {b: fade-in(red, -0.001)} - -<===> error/too_low/fade_in/error -Error: $amount: Expected -0.001 to be within 0 and 1. - , -1 | a {b: fade-in(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_low/fade_out/input.scss -a {b: fade-out(red, -0.001)} - -<===> error/too_low/fade_out/error -Error: $amount: Expected -0.001 to be within 0 and 1. - , -1 | a {b: fade-out(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/alpha.hrx b/spec/core_functions/global/color/alpha.hrx new file mode 100644 index 0000000000..ab487af7de --- /dev/null +++ b/spec/core_functions/global/color/alpha.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: alpha(#abcdef)} + +<===> output.css +a { + b: 1; +} diff --git a/spec/core_functions/global/color/blue.hrx b/spec/core_functions/global/color/blue.hrx new file mode 100644 index 0000000000..8f3126d10a --- /dev/null +++ b/spec/core_functions/global/color/blue.hrx @@ -0,0 +1,20 @@ +<===> input.scss +a {b: blue(#abcdef)} + +<===> output.css +a { + b: 239; +} + +<===> warning +DEPRECATION WARNING: blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: blue(#abcdef)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/change.hrx b/spec/core_functions/global/color/change.hrx new file mode 100644 index 0000000000..422e24da4b --- /dev/null +++ b/spec/core_functions/global/color/change.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: change-color(#abcdef, $red: 10)} + +<===> output.css +a { + b: #0acdef; +} diff --git a/spec/core_functions/global/color/complement.hrx b/spec/core_functions/global/color/complement.hrx new file mode 100644 index 0000000000..a92e5ecad8 --- /dev/null +++ b/spec/core_functions/global/color/complement.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: complement(#abcdef)} + +<===> output.css +a { + b: #efcdab; +} diff --git a/spec/core_functions/global/color/darken.hrx b/spec/core_functions/global/color/darken.hrx new file mode 100644 index 0000000000..c43a100a20 --- /dev/null +++ b/spec/core_functions/global/color/darken.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: darken(#abcdef, 10%)} + +<===> output.css +a { + b: rgb(128.16, 179.5, 230.84); +} + +<===> warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -12.4390243902%) +color.adjust($color, $lightness: -10%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: darken(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/desaturate.hrx b/spec/core_functions/global/color/desaturate.hrx new file mode 100644 index 0000000000..d7a75ae670 --- /dev/null +++ b/spec/core_functions/global/color/desaturate.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: desaturate(#abcdef, 10%)} + +<===> output.css +a { + b: #b0cdea; +} + +<===> warning +DEPRECATION WARNING: desaturate() is deprecated. Suggestions: + +color.scale($color, $saturation: -14.7058823529%) +color.adjust($color, $saturation: -10%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: desaturate(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/error.hrx b/spec/core_functions/global/color/error.hrx new file mode 100644 index 0000000000..4a702d0de9 --- /dev/null +++ b/spec/core_functions/global/color/error.hrx @@ -0,0 +1,75 @@ +<===> too_low/lighten/input.scss +a {b: lighten(red, -0.001)} + +<===> too_low/lighten/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: lighten(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_low/darken/input.scss +a {b: darken(red, -0.001)} + +<===> too_low/darken/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: darken(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_low/saturate/input.scss +a {b: saturate(red, -0.001)} + +<===> too_low/saturate/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: saturate(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_low/desaturate/input.scss +a {b: desaturate(red, -0.001)} + +<===> too_low/desaturate/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: desaturate(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_low/fade_in/input.scss +a {b: fade-in(red, -0.001)} + +<===> too_low/fade_in/error +Error: $amount: Expected -0.001 to be within 0 and 1. + , +1 | a {b: fade-in(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> too_low/fade_out/input.scss +a {b: fade-out(red, -0.001)} + +<===> too_low/fade_out/error +Error: $amount: Expected -0.001 to be within 0 and 1. + , +1 | a {b: fade-out(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/fade-in.hrx b/spec/core_functions/global/color/fade-in.hrx new file mode 100644 index 0000000000..0bd3f2317e --- /dev/null +++ b/spec/core_functions/global/color/fade-in.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: fade-in(rgba(red, 0.5), 0.3)} + +<===> output.css +a { + b: rgba(255, 0, 0, 0.8); +} + +<===> warning +DEPRECATION WARNING: fade-in() is deprecated. Suggestions: + +color.scale($color, $alpha: 60%) +color.adjust($color, $alpha: 0.3) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-in(rgba(red, 0.5), 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/fade-out.hrx b/spec/core_functions/global/color/fade-out.hrx new file mode 100644 index 0000000000..b11d2f0942 --- /dev/null +++ b/spec/core_functions/global/color/fade-out.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: fade-out(rgba(red, 0.5), 0.3)} + +<===> output.css +a { + b: rgba(255, 0, 0, 0.2); +} + +<===> warning +DEPRECATION WARNING: fade-out() is deprecated. Suggestions: + +color.scale($color, $alpha: -60%) +color.adjust($color, $alpha: -0.3) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: fade-out(rgba(red, 0.5), 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/grayscale.hrx b/spec/core_functions/global/color/grayscale.hrx new file mode 100644 index 0000000000..d340eb2c4b --- /dev/null +++ b/spec/core_functions/global/color/grayscale.hrx @@ -0,0 +1,49 @@ +<===> with_color/input.scss +a {b: grayscale(red)} + +<===> with_color/output.css +a { + b: rgb(127.5, 127.5, 127.5); +} + +<===> +================================================================================ +<===> with_number/input.scss +// A number should produce a plain function string, for CSS filter functions. +a {b: grayscale(15%)} + +<===> with_number/output.css +a { + b: grayscale(15%); +} + +<===> +================================================================================ +<===> with_css_var/input.scss +a {b: grayscale(var(--c))} + +<===> with_css_var/output.css +a { + b: grayscale(var(--c)); +} + +<===> +================================================================================ +<===> with_calc/input.scss +a {b: grayscale(calc(1 + 2))} + +<===> with_calc/output.css +a { + b: grayscale(3); +} + +<===> +================================================================================ +<===> with_unquoted_calc/input.scss +@use "sass:string"; +a {b: grayscale(string.unquote('calc(1)'))} + +<===> with_unquoted_calc/output.css +a { + b: grayscale(calc(1)); +} diff --git a/spec/core_functions/global/color/green.hrx b/spec/core_functions/global/color/green.hrx new file mode 100644 index 0000000000..1c7847ec95 --- /dev/null +++ b/spec/core_functions/global/color/green.hrx @@ -0,0 +1,20 @@ +<===> input.scss +a {b: green(#abcdef)} + +<===> output.css +a { + b: 205; +} + +<===> warning +DEPRECATION WARNING: green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: green(#abcdef)} + | ^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/hue.hrx b/spec/core_functions/global/color/hue.hrx new file mode 100644 index 0000000000..83ee872fa0 --- /dev/null +++ b/spec/core_functions/global/color/hue.hrx @@ -0,0 +1,20 @@ +<===> input.scss +a {b: hue(#abcdef)} + +<===> output.css +a { + b: 210deg; +} + +<===> warning +DEPRECATION WARNING: hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: hue(#abcdef)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/ie_hex_str.hrx b/spec/core_functions/global/color/ie_hex_str.hrx new file mode 100644 index 0000000000..faff0dcdfb --- /dev/null +++ b/spec/core_functions/global/color/ie_hex_str.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: ie-hex-str(#abcdef)} + +<===> output.css +a { + b: #FFABCDEF; +} diff --git a/spec/core_functions/global/color/invert.hrx b/spec/core_functions/global/color/invert.hrx new file mode 100644 index 0000000000..f283721d97 --- /dev/null +++ b/spec/core_functions/global/color/invert.hrx @@ -0,0 +1,48 @@ +<===> with_color/input.scss +a {b: invert(#abcdef)} + +<===> with_color/output.css +a { + b: #543210; +} + +<===> +================================================================================ +<===> with_number/input.scss +a {b: invert(10%)} + +<===> with_number/output.css +a { + b: invert(10%); +} + +<===> +================================================================================ +<===> with_css_var/input.scss +a {b: invert(var(--c))} + +<===> with_css_var/output.css +a { + b: invert(var(--c)); +} + +<===> +================================================================================ +<===> with_calc/input.scss +a {b: invert(calc(1 + 2))} + +<===> with_calc/output.css +a { + b: invert(3); +} + +<===> +================================================================================ +<===> with_unquoted_calc/input.scss +@use "sass:string"; +a {b: invert(string.unquote('calc(1)'))} + +<===> with_unquoted_calc/output.css +a { + b: invert(calc(1)); +} diff --git a/spec/core_functions/global/color/lighten.hrx b/spec/core_functions/global/color/lighten.hrx new file mode 100644 index 0000000000..2567e3adc2 --- /dev/null +++ b/spec/core_functions/global/color/lighten.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: lighten(#abcdef, 10%)} + +<===> output.css +a { + b: rgb(213.84, 230.5, 247.16); +} + +<===> warning +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 51%) +color.adjust($color, $lightness: 10%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lighten(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/lightness.hrx b/spec/core_functions/global/color/lightness.hrx new file mode 100644 index 0000000000..cc98cf849d --- /dev/null +++ b/spec/core_functions/global/color/lightness.hrx @@ -0,0 +1,20 @@ +<===> input.scss +a {b: lightness(#abcdef)} + +<===> output.css +a { + b: 80.3921568627%; +} + +<===> warning +DEPRECATION WARNING: lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: lightness(#abcdef)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/mix.hrx b/spec/core_functions/global/color/mix.hrx new file mode 100644 index 0000000000..c58c24f4d5 --- /dev/null +++ b/spec/core_functions/global/color/mix.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: mix(#abcdef, #daddee)} + +<===> output.css +a { + b: rgb(194.5, 213, 238.5); +} diff --git a/spec/core_functions/global/color/opacify.hrx b/spec/core_functions/global/color/opacify.hrx new file mode 100644 index 0000000000..5d78f806c2 --- /dev/null +++ b/spec/core_functions/global/color/opacify.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: opacify(rgba(red, 0.5), 0.3)} + +<===> output.css +a { + b: rgba(255, 0, 0, 0.8); +} + +<===> warning +DEPRECATION WARNING: opacify() is deprecated. Suggestions: + +color.scale($color, $alpha: 60%) +color.adjust($color, $alpha: 0.3) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: opacify(rgba(red, 0.5), 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/opacity.hrx b/spec/core_functions/global/color/opacity.hrx new file mode 100644 index 0000000000..1073c8104f --- /dev/null +++ b/spec/core_functions/global/color/opacity.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: opacity(#abcdef)} + +<===> output.css +a { + b: 1; +} diff --git a/spec/core_functions/global/color/red.hrx b/spec/core_functions/global/color/red.hrx new file mode 100644 index 0000000000..1c8b799a1b --- /dev/null +++ b/spec/core_functions/global/color/red.hrx @@ -0,0 +1,20 @@ +<===> input.scss +a {b: red(#abcdef)} + +<===> output.css +a { + b: 171; +} + +<===> warning +DEPRECATION WARNING: red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: red(#abcdef)} + | ^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/saturate.hrx b/spec/core_functions/global/color/saturate.hrx new file mode 100644 index 0000000000..f8b0c74657 --- /dev/null +++ b/spec/core_functions/global/color/saturate.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: saturate(#abcdef, 10%)} + +<===> output.css +a { + b: #a6cdf4; +} + +<===> warning +DEPRECATION WARNING: saturate() is deprecated. Suggestions: + +color.scale($color, $saturation: 31.25%) +color.adjust($color, $saturation: 10%) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturate(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/saturation.hrx b/spec/core_functions/global/color/saturation.hrx new file mode 100644 index 0000000000..6b137ad890 --- /dev/null +++ b/spec/core_functions/global/color/saturation.hrx @@ -0,0 +1,20 @@ +<===> input.scss +a {b: saturation(#abcdef)} + +<===> output.css +a { + b: 68%; +} + +<===> warning +DEPRECATION WARNING: saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: saturation(#abcdef)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/color/scale.hrx b/spec/core_functions/global/color/scale.hrx new file mode 100644 index 0000000000..0825f037a7 --- /dev/null +++ b/spec/core_functions/global/color/scale.hrx @@ -0,0 +1,7 @@ +<===> input.scss +a {b: scale-color(#abcdef, $red: 10%)} + +<===> output.css +a { + b: rgb(179.4, 205, 239); +} diff --git a/spec/core_functions/global/color/transparentize.hrx b/spec/core_functions/global/color/transparentize.hrx new file mode 100644 index 0000000000..f1bbfdb4e6 --- /dev/null +++ b/spec/core_functions/global/color/transparentize.hrx @@ -0,0 +1,21 @@ +<===> input.scss +a {b: transparentize(rgba(red, 0.5), 0.3)} + +<===> output.css +a { + b: rgba(255, 0, 0, 0.2); +} + +<===> warning +DEPRECATION WARNING: transparentize() is deprecated. Suggestions: + +color.scale($color, $alpha: -60%) +color.adjust($color, $alpha: -0.3) + +More info: https://sass-lang.com/d/color-functions + + , +1 | a {b: transparentize(rgba(red, 0.5), 0.3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/list/join/single.hrx b/spec/core_functions/list/join/single.hrx index 939d37d851..ecc6ebcba1 100644 --- a/spec/core_functions/list/join/single.hrx +++ b/spec/core_functions/list/join/single.hrx @@ -268,9 +268,6 @@ $result: list.join(c, ()); a { value: meta.inspect($result); type: meta.type-of($result); - - // Note: LibSass's output here is strange but not strictly-speaking wrong. - // See sass/libsass#2926 for details. separator: utils.real-separator($result); } @@ -326,9 +323,6 @@ $result: list.join((), c); a { value: meta.inspect($result); type: meta.type-of($result); - - // Note: LibSass's output here is strange but not strictly-speaking wrong. - // See sass/libsass#2926 for details. separator: utils.real-separator($result); } diff --git a/spec/core_functions/math/round.hrx b/spec/core_functions/math/round.hrx index f24018d42c..e690e06f42 100644 --- a/spec/core_functions/math/round.hrx +++ b/spec/core_functions/math/round.hrx @@ -86,10 +86,6 @@ a { <===> ================================================================================ -<===> down/within_precision/options.yml -:ignore_for: - - libsass - <===> down/within_precision/input.scss // This is the largest number that's representable as a float and outside the // precision range to be considered equal to 1.5. diff --git a/spec/core_functions/meta/call.hrx b/spec/core_functions/meta/call.hrx index 68619631b5..4350b7e64c 100644 --- a/spec/core_functions/meta/call.hrx +++ b/spec/core_functions/meta/call.hrx @@ -162,7 +162,7 @@ Error: Missing argument $function. a {b: meta.call(meta.get-function("rgb"), 1)} <===> error/invalid_args/error -Error: Missing element $green. +Error: $channels: The rgb color space has 3 channels but 1 has 1. , 2 | a {b: meta.call(meta.get-function("rgb"), 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/meta/content_exists.hrx b/spec/core_functions/meta/content_exists.hrx index dfaaeeb9fa..4d6ff6bad0 100644 --- a/spec/core_functions/meta/content_exists.hrx +++ b/spec/core_functions/meta/content_exists.hrx @@ -1,7 +1,3 @@ -<===> false/top_level/options.yml -:todo: - - libsass - <===> false/top_level/input.scss @use "sass:meta"; @mixin a { @@ -52,10 +48,6 @@ b { <===> ================================================================================ -<===> true/non_empty/options.yml -:todo: - - libsass - <===> true/non_empty/input.scss @use "sass:meta"; @mixin a { @@ -75,12 +67,6 @@ d { e: f; } -<===> -================================================================================ -<===> controls/options.yml -:todo: - - libsass - <===> ================================================================================ <===> controls/true/input.scss diff --git a/spec/core_functions/meta/get_function/different_module.hrx b/spec/core_functions/meta/get_function/different_module.hrx index ff31f2ac25..b6b5baa84c 100644 --- a/spec/core_functions/meta/get_function/different_module.hrx +++ b/spec/core_functions/meta/get_function/different_module.hrx @@ -1,23 +1,23 @@ <===> defined/input.scss +@use "sass:math"; @use "sass:meta"; -@use "sass:color"; -a {b: meta.call(meta.get-function("red", $module: "color"), #abcdef)} +a {b: meta.call(meta.get-function("round", $module: "math"), 0.6)} <===> defined/output.css a { - b: 171; + b: 1; } <===> ================================================================================ <===> chosen_prefix/input.scss @use "sass:meta"; -@use "sass:color" as a; -b {c: meta.call(meta.get-function("red", $module: "a"), #abcdef)} +@use "sass:math" as a; +b {c: meta.call(meta.get-function("round", $module: "a"), 0.6)} <===> chosen_prefix/output.css b { - c: 171; + c: 1; } <===> @@ -115,16 +115,12 @@ a { <===> ================================================================================ -<===> named/options.yml -:todo: - - libsass - <===> named/input.scss @use "sass:meta"; -@use "sass:color"; -a {b: meta.call(meta.get-function($name: "red", $module: "color"), #abcdef)} +@use "sass:math"; +a {b: meta.call(meta.get-function($name: "round", $module: "math"), 0.6)} <===> named/output.css a { - b: 171; + b: 1; } diff --git a/spec/core_functions/meta/get_function/same_module.hrx b/spec/core_functions/meta/get_function/same_module.hrx index 44c2ae7a08..b7f7cd228f 100644 --- a/spec/core_functions/meta/get_function/same_module.hrx +++ b/spec/core_functions/meta/get_function/same_module.hrx @@ -33,13 +33,13 @@ a { ================================================================================ <===> built_in/input.scss @use "sass:meta"; -$lighten-fn: meta.get-function(lighten); +$round-fn: meta.get-function(round); -a {b: meta.call($lighten-fn, red, 30%)} +a {b: meta.call($round-fn, 0.6)} <===> built_in/output.css a { - b: #ff9999; + b: 1; } <===> @@ -61,18 +61,18 @@ a { ================================================================================ <===> plain_css/input.scss @use "sass:meta"; -$sass-fn: meta.get-function(lighten); -$css-fn: meta.get-function(lighten, $css: true); +$sass-fn: meta.get-function(round); +$css-fn: meta.get-function(round, $css: true); a { - sass-fn: meta.call($sass-fn, red, 30%); - css-fn: meta.call($css-fn, red, 30%); + sass-fn: meta.call($sass-fn, 0.6); + css-fn: meta.call($css-fn, 0.6); } <===> plain_css/output.css a { - sass-fn: #ff9999; - css-fn: lighten(red, 30%); + sass-fn: 1; + css-fn: round(0.6); } <===> diff --git a/spec/core_functions/meta/get_mixin/different_module.hrx b/spec/core_functions/meta/get_mixin/different_module.hrx index fab7cf8de2..ea68b2b103 100644 --- a/spec/core_functions/meta/get_mixin/different_module.hrx +++ b/spec/core_functions/meta/get_mixin/different_module.hrx @@ -5,7 +5,7 @@ a {@include meta.apply(meta.get-mixin("a", $module: "other"), #abcdef)} <===> defined/_other.scss @use "sass:color"; -@mixin a($color) {b: color.red($color)} +@mixin a($color) {b: color.channel($color, 'red')} <===> defined/output.css a { @@ -21,7 +21,7 @@ b {@include meta.apply(meta.get-mixin("a", $module: "a"), #abcdef)} <===> chosen_prefix/_other.scss @use "sass:color"; -@mixin a($color) {c: color.red($color)} +@mixin a($color) {c: color.channel($color, 'red')} <===> chosen_prefix/output.css b { @@ -124,7 +124,7 @@ a {@include meta.apply(meta.get-mixin($name: "a", $module: "other"), #abcdef)} <===> named/_other.scss @use "sass:color"; -@mixin a($color) {b: color.red($color)} +@mixin a($color) {b: color.channel($color, 'red')} <===> named/output.css a { diff --git a/spec/core_functions/meta/get_mixin/scope.hrx b/spec/core_functions/meta/get_mixin/scope.hrx index d5fb42507f..f463277c34 100644 --- a/spec/core_functions/meta/get_mixin/scope.hrx +++ b/spec/core_functions/meta/get_mixin/scope.hrx @@ -1,7 +1,3 @@ -<===> stores_local_scope/options.yml -:todo: - - libsass - <===> stores_local_scope/input.scss @use "sass:meta"; $add-two-mixin: null; diff --git a/spec/core_functions/meta/keywords.hrx b/spec/core_functions/meta/keywords.hrx index 13de5458e4..f6d7154b7c 100644 --- a/spec/core_functions/meta/keywords.hrx +++ b/spec/core_functions/meta/keywords.hrx @@ -157,7 +157,7 @@ a { a {b: meta.keywords(1 2 3)} <===> error/type/non_arg_list/error -Error: $args: 1 2 3 is not an argument list. +Error: $args: (1 2 3) is not an argument list. , 2 | a {b: meta.keywords(1 2 3)} | ^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/core_functions/modules/color/adjust.hrx b/spec/core_functions/modules/color/adjust.hrx new file mode 100644 index 0000000000..315bc9323b --- /dev/null +++ b/spec/core_functions/modules/color/adjust.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.adjust(#abcdef, $red: 10)} + +<===> output.css +a { + b: #b5cdef; +} diff --git a/spec/core_functions/modules/color/alpha.hrx b/spec/core_functions/modules/color/alpha.hrx new file mode 100644 index 0000000000..74d4e34fd2 --- /dev/null +++ b/spec/core_functions/modules/color/alpha.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.alpha(#abcdef)} + +<===> output.css +a { + b: 1; +} diff --git a/spec/core_functions/modules/color/blue.hrx b/spec/core_functions/modules/color/blue.hrx new file mode 100644 index 0000000000..29180df53b --- /dev/null +++ b/spec/core_functions/modules/color/blue.hrx @@ -0,0 +1,21 @@ +<===> input.scss +@use "sass:color"; +a {b: color.blue(#abcdef)} + +<===> output.css +a { + b: 239; +} + +<===> warning +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.blue(#abcdef)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/change.hrx b/spec/core_functions/modules/color/change.hrx new file mode 100644 index 0000000000..4af8a6a242 --- /dev/null +++ b/spec/core_functions/modules/color/change.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.change(#abcdef, $red: 10)} + +<===> output.css +a { + b: #0acdef; +} diff --git a/spec/core_functions/modules/color/complement.hrx b/spec/core_functions/modules/color/complement.hrx new file mode 100644 index 0000000000..facd7558ae --- /dev/null +++ b/spec/core_functions/modules/color/complement.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.complement(#abcdef)} + +<===> output.css +a { + b: #efcdab; +} diff --git a/spec/core_functions/modules/color/css_overloads.hrx b/spec/core_functions/modules/color/css_overloads.hrx new file mode 100644 index 0000000000..89af6b73a0 --- /dev/null +++ b/spec/core_functions/modules/color/css_overloads.hrx @@ -0,0 +1,113 @@ +<===> README.md +CSS overloads are still supported for module functions to ease the transition, +but they should produce deprecation warnings. + +<===> +================================================================================ +<===> grayscale/input.scss +@use "sass:color"; +a {b: color.grayscale(1)} + +<===> grayscale/output.css +a { + b: grayscale(1); +} + +<===> grayscale/warning +DEPRECATION WARNING: Passing a number (1) to color.grayscale() is deprecated. + +Recommendation: grayscale(1) + + , +2 | a {b: color.grayscale(1)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> invert/input.scss +@use "sass:color"; +a {b: color.invert(1)} + +<===> invert/output.css +a { + b: invert(1); +} + +<===> invert/warning +DEPRECATION WARNING: Passing a number (1) to color.invert() is deprecated. + +Recommendation: invert(1) + + , +2 | a {b: color.invert(1)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/one_arg/input.scss +@use "sass:color"; +a {b: color.alpha(c=d)} + +<===> alpha/one_arg/output.css +a { + b: alpha(c=d); +} + +<===> alpha/one_arg/warning +DEPRECATION WARNING: Using color.alpha() for a Microsoft filter is deprecated. + +Recommendation: alpha(c=d) + + , +2 | a {b: color.alpha(c=d)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/multi_arg/input.scss +@use "sass:color"; +a {b: color.alpha(c=d, e=f, g=h)} + +<===> alpha/multi_arg/output.css +a { + b: alpha(c=d, e=f, g=h); +} + +<===> alpha/multi_arg/warning +DEPRECATION WARNING: Using color.alpha() for a Microsoft filter is deprecated. + +Recommendation: alpha(c=d, e=f, g=h) + + , +2 | a {b: color.alpha(c=d, e=f, g=h)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> opacity/input.scss +@use "sass:color"; +a {b: color.opacity(1)} + +<===> opacity/output.css +a { + b: opacity(1); +} + +<===> opacity/warning +DEPRECATION WARNING: Passing a number (1 to color.opacity() is deprecated. + +Recommendation: opacity(1) + + , +2 | a {b: color.opacity(1)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/error.hrx b/spec/core_functions/modules/color/error.hrx new file mode 100644 index 0000000000..d15430973d --- /dev/null +++ b/spec/core_functions/modules/color/error.hrx @@ -0,0 +1,201 @@ +<===> adjust_color/input.scss +@use "sass:color"; +a {b: color.adjust-color(#abcdef, $red: 10)} + +<===> adjust_color/error +Error: Undefined function. + , +2 | a {b: color.adjust-color(#abcdef, $red: 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> scale_color/input.scss +@use "sass:color"; +a {b: color.scale-color(#abcdef, $red: 10%)} + +<===> scale_color/error +Error: Undefined function. + , +2 | a {b: color.scale-color(#abcdef, $red: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> change_color/input.scss +@use "sass:color"; +a {b: color.change-color(#abcdef, $red: 10)} + +<===> change_color/error +Error: Undefined function. + , +2 | a {b: color.change-color(#abcdef, $red: 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> adjust_hue/input.scss +@use "sass:color"; +a {b: color.adjust-hue(#abcdef, 10)} + +<===> adjust_hue/error +Error: The function adjust-hue() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $hue: 10) + +More info: https://sass-lang.com/documentation/functions/color#adjust-hue + , +2 | a {b: color.adjust-hue(#abcdef, 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> lighten/input.scss +@use "sass:color"; +a {b: color.lighten(#abcdef, 10%)} + +<===> lighten/error +Error: The function lighten() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $lightness: 10%) + +More info: https://sass-lang.com/documentation/functions/color#lighten + , +2 | a {b: color.lighten(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> darken/input.scss +@use "sass:color"; +a {b: color.darken(#abcdef, 10%)} + +<===> darken/error +Error: The function darken() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $lightness: -10%) + +More info: https://sass-lang.com/documentation/functions/color#darken + , +2 | a {b: color.darken(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> saturate/input.scss +@use "sass:color"; +a {b: color.saturate(#abcdef, 10%)} + +<===> saturate/error +Error: The function saturate() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $saturation: 10%) + +More info: https://sass-lang.com/documentation/functions/color#saturate + , +2 | a {b: color.saturate(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> desaturate/input.scss +@use "sass:color"; +a {b: color.desaturate(#abcdef, 10%)} + +<===> desaturate/error +Error: The function desaturate() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $saturation: -10%) + +More info: https://sass-lang.com/documentation/functions/color#desaturate + , +2 | a {b: color.desaturate(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> opacify/input.scss +@use "sass:color"; +a {b: color.opacify(#abcdef, 0.5)} + +<===> opacify/error +Error: The function opacify() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: 0.5) + +More info: https://sass-lang.com/documentation/functions/color#opacify + , +2 | a {b: color.opacify(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> fade_in/input.scss +@use "sass:color"; +a {b: color.fade-in(#abcdef, 0.5)} + +<===> fade_in/error +Error: The function fade-in() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: 0.5) + +More info: https://sass-lang.com/documentation/functions/color#fade-in + , +2 | a {b: color.fade-in(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> transparentize/input.scss +@use "sass:color"; +a {b: color.transparentize(#abcdef, 0.5)} + +<===> transparentize/error +Error: The function transparentize() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: -0.5) + +More info: https://sass-lang.com/documentation/functions/color#transparentize + , +2 | a {b: color.transparentize(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> fade_out/input.scss +@use "sass:color"; +a {b: color.fade-out(#abcdef, 0.5)} + +<===> fade_out/error +Error: The function fade-out() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: -0.5) + +More info: https://sass-lang.com/documentation/functions/color#fade-out + , +2 | a {b: color.fade-out(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/green.hrx b/spec/core_functions/modules/color/green.hrx new file mode 100644 index 0000000000..4799398cdb --- /dev/null +++ b/spec/core_functions/modules/color/green.hrx @@ -0,0 +1,21 @@ +<===> input.scss +@use "sass:color"; +a {b: color.green(#abcdef)} + +<===> output.css +a { + b: 205; +} + +<===> warning +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.green(#abcdef)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/hue.hrx b/spec/core_functions/modules/color/hue.hrx new file mode 100644 index 0000000000..db41d37652 --- /dev/null +++ b/spec/core_functions/modules/color/hue.hrx @@ -0,0 +1,21 @@ +<===> input.scss +@use "sass:color"; +a {b: color.hue(#abcdef)} + +<===> output.css +a { + b: 210deg; +} + +<===> warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.hue(#abcdef)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/ie_hex_str.hrx b/spec/core_functions/modules/color/ie_hex_str.hrx new file mode 100644 index 0000000000..22dc21e0ca --- /dev/null +++ b/spec/core_functions/modules/color/ie_hex_str.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.ie-hex-str(#abcdef)} + +<===> output.css +a { + b: #FFABCDEF; +} diff --git a/spec/core_functions/modules/color/invert.hrx b/spec/core_functions/modules/color/invert.hrx new file mode 100644 index 0000000000..a90cbcf51f --- /dev/null +++ b/spec/core_functions/modules/color/invert.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.invert(#abcdef)} + +<===> output.css +a { + b: #543210; +} diff --git a/spec/core_functions/modules/color/lightness.hrx b/spec/core_functions/modules/color/lightness.hrx new file mode 100644 index 0000000000..8725ff5b01 --- /dev/null +++ b/spec/core_functions/modules/color/lightness.hrx @@ -0,0 +1,21 @@ +<===> input.scss +@use "sass:color"; +a {b: color.lightness(#abcdef)} + +<===> output.css +a { + b: 80.3921568627%; +} + +<===> warning +DEPRECATION WARNING: color.lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.lightness(#abcdef)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/mix.hrx b/spec/core_functions/modules/color/mix.hrx new file mode 100644 index 0000000000..82fb2dcac9 --- /dev/null +++ b/spec/core_functions/modules/color/mix.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.mix(#abcdef, #daddee)} + +<===> output.css +a { + b: rgb(194.5, 213, 238.5); +} diff --git a/spec/core_functions/modules/color/red.hrx b/spec/core_functions/modules/color/red.hrx new file mode 100644 index 0000000000..7451a39ef3 --- /dev/null +++ b/spec/core_functions/modules/color/red.hrx @@ -0,0 +1,21 @@ +<===> input.scss +@use "sass:color"; +a {b: color.red(#abcdef)} + +<===> output.css +a { + b: 171; +} + +<===> warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.red(#abcdef)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/saturation.hrx b/spec/core_functions/modules/color/saturation.hrx new file mode 100644 index 0000000000..8d66b7cb5d --- /dev/null +++ b/spec/core_functions/modules/color/saturation.hrx @@ -0,0 +1,21 @@ +<===> input.scss +@use "sass:color"; +a {b: color.saturation(#abcdef)} + +<===> output.css +a { + b: 68%; +} + +<===> warning +DEPRECATION WARNING: color.saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +2 | a {b: color.saturation(#abcdef)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/color/scale.hrx b/spec/core_functions/modules/color/scale.hrx new file mode 100644 index 0000000000..6f806f8547 --- /dev/null +++ b/spec/core_functions/modules/color/scale.hrx @@ -0,0 +1,8 @@ +<===> input.scss +@use "sass:color"; +a {b: color.scale(#abcdef, $red: 10%)} + +<===> output.css +a { + b: rgb(179.4, 205, 239); +} diff --git a/spec/core_functions/selector/extend/simple/pseudo/selector/idempotent/not.hrx b/spec/core_functions/selector/extend/simple/pseudo/selector/idempotent/not.hrx index 40873e9c78..ac68928790 100644 --- a/spec/core_functions/selector/extend/simple/pseudo/selector/idempotent/not.hrx +++ b/spec/core_functions/selector/extend/simple/pseudo/selector/idempotent/not.hrx @@ -76,10 +76,6 @@ a { <===> ================================================================================ -<===> is/list_of_complex/options.yml -:todo: - - libsass - <===> is/list_of_complex/input.scss @use "sass:selector"; a {b: selector.extend(":not(.c)", ".c", ":is(.d .e, .f .g)")} diff --git a/spec/core_functions/selector/parse/error.hrx b/spec/core_functions/selector/parse/error.hrx index df627bca07..053f74686d 100644 --- a/spec/core_functions/selector/parse/error.hrx +++ b/spec/core_functions/selector/parse/error.hrx @@ -92,7 +92,7 @@ a list of strings, or a list of lists of strings. a {b: selector.parse(list.append((), list.append((), c)))} <===> outer_space/error -Error: $selector: c is not a valid selector: it must be a string, +Error: $selector: (c) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , 3 | a {b: selector.parse(list.append((), list.append((), c)))} @@ -108,7 +108,7 @@ a list of strings, or a list of lists of strings. a {b: selector.parse(list.slash(c d, e f))} <===> slash_list/top_level/error -Error: $selector: c d / e f is not a valid selector: it must be a string, +Error: $selector: (c d / e f) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , 3 | a {b: selector.parse(list.slash(c d, e f))} @@ -124,7 +124,7 @@ a list of strings, or a list of lists of strings. a {b: selector.parse((list.slash(c, d), list.slash(e, f)))} <===> slash_list/in_comma_list/error -Error: $selector: c / d, e / f is not a valid selector: it must be a string, +Error: $selector: (c / d, e / f) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , 3 | a {b: selector.parse((list.slash(c, d), list.slash(e, f)))} diff --git a/spec/core_functions/string/quote.hrx b/spec/core_functions/string/quote.hrx index 95276bf45e..7ebeee5a4b 100644 --- a/spec/core_functions/string/quote.hrx +++ b/spec/core_functions/string/quote.hrx @@ -82,7 +82,7 @@ a { a {b: string.quote((1, 2, 3))} <===> error/type/error -Error: $string: 1, 2, 3 is not a string. +Error: $string: (1, 2, 3) is not a string. , 2 | a {b: string.quote((1, 2, 3))} | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/css/selector/placeholder.hrx b/spec/css/selector/placeholder.hrx index 7bb34d60c5..0e038ae008 100644 --- a/spec/css/selector/placeholder.hrx +++ b/spec/css/selector/placeholder.hrx @@ -41,8 +41,6 @@ a:where(c) { <===> pseudoselectors/where/nesting/options.yml :todo: - sass/dart-sass#1451 -:ignore_for: - - libsass <===> pseudoselectors/where/nesting/input.scss a { diff --git a/spec/directives/forward/escaped.hrx b/spec/directives/forward/escaped.hrx index cbeea3e658..e5db25747f 100644 --- a/spec/directives/forward/escaped.hrx +++ b/spec/directives/forward/escaped.hrx @@ -1,7 +1,3 @@ -<===> options.yml -:todo: - - libsass - <===> input.scss @fo\72ward "other" diff --git a/spec/directives/use/escaped.hrx b/spec/directives/use/escaped.hrx index 37dfe7957e..9badff6ca6 100644 --- a/spec/directives/use/escaped.hrx +++ b/spec/directives/use/escaped.hrx @@ -1,7 +1,3 @@ -<===> options.yml -:todo: - - libsass - <===> input.scss @u\73 e "other" diff --git a/spec/libsass-closed-issues/issue_1075.hrx b/spec/libsass-closed-issues/issue_1075.hrx index 7f4ba9e0ac..93d957d2f0 100644 --- a/spec/libsass-closed-issues/issue_1075.hrx +++ b/spec/libsass-closed-issues/issue_1075.hrx @@ -21,3 +21,16 @@ Recommendation: call(get-function("lighten")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 5:8 root stylesheet + +DEPRECATION WARNING: lighten() is deprecated. Suggestions: + +color.scale($color, $lightness: 20%) +color.adjust($color, $lightness: 10%) + +More info: https://sass-lang.com/d/color-functions + + , +5 | bar: meta.call($name, $args...); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 5:8 root stylesheet diff --git a/spec/libsass-closed-issues/issue_1101.hrx b/spec/libsass-closed-issues/issue_1101.hrx index d739f9334f..4634f8d0a3 100644 --- a/spec/libsass-closed-issues/issue_1101.hrx +++ b/spec/libsass-closed-issues/issue_1101.hrx @@ -6,5 +6,5 @@ foo { } <===> output.css foo { - bar: #d6d6d6; + bar: rgb(214.2, 214.2, 214.2); } diff --git a/spec/libsass-closed-issues/issue_1132.hrx b/spec/libsass-closed-issues/issue_1132.hrx index 96ceb265d3..422793c353 100644 --- a/spec/libsass-closed-issues/issue_1132.hrx +++ b/spec/libsass-closed-issues/issue_1132.hrx @@ -370,3 +370,16 @@ foo { i359: 359deg; i360: 0deg; } + +<===> warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +4 | i#{$i}: color.hue(hsl($i, 10%, 20%)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 4:13 root stylesheet diff --git a/spec/libsass-closed-issues/issue_1285.hrx b/spec/libsass-closed-issues/issue_1285.hrx index d728197a1e..fa21fbf00d 100644 --- a/spec/libsass-closed-issues/issue_1285.hrx +++ b/spec/libsass-closed-issues/issue_1285.hrx @@ -1,3 +1,7 @@ +<===> options.yml +:warning_todo: + - libsass + <===> input.scss @use "sass:color"; .container { @@ -15,14 +19,17 @@ <===> output.css .box-1 { - color: #e60000; + color: rgb(229.5, 0, 0); } + .box-2 { color: #cc0000; } + .box-3 { - color: #b30000; + color: rgb(178.5, 0, 0); } + .outside-child { background-color: blue; } diff --git a/spec/libsass-closed-issues/issue_221255.hrx b/spec/libsass-closed-issues/issue_221255.hrx index d0e86470e3..b17fef082b 100644 --- a/spec/libsass-closed-issues/issue_221255.hrx +++ b/spec/libsass-closed-issues/issue_221255.hrx @@ -1,10 +1,10 @@ -<===> options.yml ---- -:todo: -- dart-sass <===> input.scss '#{)'{ + <===> error -Error: Invalid CSS after "'#{": expected expression (e.g. 1px, bold), was ")'{" - on line 1 of input.scss - Use --trace for backtrace. +Error: Expected expression. + , +1 | '#{)'{ + | ^^ + ' + input.scss 1:2 root stylesheet diff --git a/spec/libsass-closed-issues/issue_2374.hrx b/spec/libsass-closed-issues/issue_2374.hrx index 5d0b4629e2..b38710d971 100644 --- a/spec/libsass-closed-issues/issue_2374.hrx +++ b/spec/libsass-closed-issues/issue_2374.hrx @@ -28,43 +28,43 @@ $colors: ( <===> output.css .yellow-0 { - background-color: white; + background-color: hsl(53.8775510204, 100%, 101.568627451%); } .yellow-100 { - background-color: #fffffd; + background-color: rgb(255, 254.7755102041, 252.8); } .yellow-200 { - background-color: #fffef3; + background-color: rgb(255, 253.7346938776, 242.6); } .yellow-300 { - background-color: #fffde8; + background-color: rgb(255, 252.693877551, 232.4); } .yellow-400 { - background-color: #fffcde; + background-color: rgb(255, 251.6530612245, 222.2); } .yellow-500 { - background-color: #fffbd4; + background-color: rgb(255, 250.612244898, 212); } .yellow-600 { - background-color: #fffaca; + background-color: rgb(255, 249.5714285714, 201.8); } .yellow-700 { - background-color: #fff9c0; + background-color: rgb(255, 248.5306122449, 191.6); } .yellow-800 { - background-color: #fff7b5; + background-color: rgb(255, 247.4897959184, 181.4); } .yellow-900 { - background-color: #fff6ab; + background-color: rgb(255, 246.4489795918, 171.2); } .yellow-0 { diff --git a/spec/libsass-closed-issues/issue_238760.hrx b/spec/libsass-closed-issues/issue_238760.hrx index f218471fdf..0e9738ac87 100644 --- a/spec/libsass-closed-issues/issue_238760.hrx +++ b/spec/libsass-closed-issues/issue_238760.hrx @@ -4,7 +4,7 @@ $id: meta.inspect((a#b:c)...) <===> error Error: Variable keyword argument map must have string keys. -a #b is not a string in (a #b: c). +(a #b) is not a string in (a #b: c). , 3 | $id: meta.inspect((a#b:c)...) | ^^^^^^^ diff --git a/spec/libsass-closed-issues/issue_2462.hrx b/spec/libsass-closed-issues/issue_2462.hrx index 2cbb857090..1b31c30e3c 100644 --- a/spec/libsass-closed-issues/issue_2462.hrx +++ b/spec/libsass-closed-issues/issue_2462.hrx @@ -6,5 +6,5 @@ b { <===> output.css b { - color: #ed365b; + color: rgb(236.75, 54.25, 90.75); } diff --git a/spec/libsass-closed-issues/issue_2472.hrx b/spec/libsass-closed-issues/issue_2472.hrx index d1ec77501f..cb87762567 100644 --- a/spec/libsass-closed-issues/issue_2472.hrx +++ b/spec/libsass-closed-issues/issue_2472.hrx @@ -23,14 +23,40 @@ $arg: join((), 5%); } <===> output.css .single { - direct: #0a131d; - arg: #0a131d; - call: #0a131d; - function: #0a131d; - function2: #0a131d; + direct: rgb(9.625, 19.25, 28.875); + arg: rgb(9.625, 19.25, 28.875); + call: rgb(9.625, 19.25, 28.875); + function: rgb(9.625, 19.25, 28.875); + function2: rgb(9.625, 19.25, 28.875); } <===> warning +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -39.84375%) +color.adjust($color, $lightness: -5%) + +More info: https://sass-lang.com/d/color-functions + + , +17 | direct: darken(#102030, 5%); + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 17:11 root stylesheet + +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -39.84375%) +color.adjust($color, $lightness: -5%) + +More info: https://sass-lang.com/d/color-functions + + , +18 | arg: darken(#102030, $arg...); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 18:8 root stylesheet + DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal in Dart Sass 2.0.0. Recommendation: call(get-function("darken")) @@ -41,6 +67,19 @@ Recommendation: call(get-function("darken")) ' input.scss 19:9 root stylesheet +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -39.84375%) +color.adjust($color, $lightness: -5%) + +More info: https://sass-lang.com/d/color-functions + + , +19 | call: call('darken', #102030, $arg...); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 19:9 root stylesheet + DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal in Dart Sass 2.0.0. Recommendation: call(get-function("darken")) @@ -52,6 +91,20 @@ Recommendation: call(get-function("darken")) input.scss 5:11 dark() input.scss 20:13 root stylesheet +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -39.84375%) +color.adjust($color, $lightness: -5%) + +More info: https://sass-lang.com/d/color-functions + + , +5 | @return call('darken', $color, $args...); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 5:11 dark() + input.scss 20:13 root stylesheet + DEPRECATION WARNING: Passing a string to call() is deprecated and will be illegal in Dart Sass 2.0.0. Recommendation: call(get-function("darken")) @@ -62,3 +115,17 @@ Recommendation: call(get-function("darken")) ' input.scss 11:11 dark2() input.scss 21:14 root stylesheet + +DEPRECATION WARNING: darken() is deprecated. Suggestions: + +color.scale($color, $lightness: -39.84375%) +color.adjust($color, $lightness: -5%) + +More info: https://sass-lang.com/d/color-functions + + , +11 | @return call('darken', $args...); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 11:11 dark2() + input.scss 21:14 root stylesheet diff --git a/spec/libsass-closed-issues/issue_2509.hrx b/spec/libsass-closed-issues/issue_2509.hrx index ce041dbc87..d04f20c994 100644 --- a/spec/libsass-closed-issues/issue_2509.hrx +++ b/spec/libsass-closed-issues/issue_2509.hrx @@ -1,8 +1,3 @@ -<===> options.yml ---- -:todo: -- dart-sass - <===> input.scss [charset i] { display: block; @@ -19,19 +14,10 @@ [charset="utf-8" I] { display: block; } -<===> output.css -[charset i] { - display: block; -} - -[charset I] { - display: block; -} - -[charset="utf-8" i] { - display: block; -} - -[charset="utf-8" I] { - display: block; -} +<===> error +Error: Expected "]". + , +1 | [charset i] { + | ^ + ' + input.scss 1:10 root stylesheet diff --git a/spec/libsass-closed-issues/issue_86.hrx b/spec/libsass-closed-issues/issue_86.hrx index 88e8572340..96b616fc7b 100644 --- a/spec/libsass-closed-issues/issue_86.hrx +++ b/spec/libsass-closed-issues/issue_86.hrx @@ -20,3 +20,88 @@ test-1: true; test-2: true; } + +<===> warning +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +6 | hue: color.hue($color); + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 6:10 root stylesheet + +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +7 | hue-type: meta.type-of(color.hue($color)); + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 7:28 root stylesheet + +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +8 | hue-unit: math.unit(color.hue($color)); + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 8:25 root stylesheet + +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +9 | hue-comparable: math.compatible(color.hue($color), color.hue($color)); + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 9:37 root stylesheet + +DEPRECATION WARNING: color.hue() is deprecated. Suggestion: + +color.channel($color, hue) + +More info: https://sass-lang.com/d/color-functions + + , +9 | hue-comparable: math.compatible(color.hue($color), color.hue($color)); + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 9:56 root stylesheet + +DEPRECATION WARNING: color.lightness() is deprecated. Suggestion: + +color.channel($color, lightness) + +More info: https://sass-lang.com/d/color-functions + + , +10 | test-1: math.compatible(color.lightness(red), 1%); + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 10:26 root stylesheet + +DEPRECATION WARNING: color.saturation() is deprecated. Suggestion: + +color.channel($color, saturation) + +More info: https://sass-lang.com/d/color-functions + + , +11 | test-2: math.compatible(color.saturation(red), 1%); + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 11:26 root stylesheet diff --git a/spec/libsass-todo-issues/issue_2051.hrx b/spec/libsass-todo-issues/issue_2051.hrx index 98d77f215a..6b3e87faee 100644 --- a/spec/libsass-todo-issues/issue_2051.hrx +++ b/spec/libsass-todo-issues/issue_2051.hrx @@ -1,7 +1,3 @@ -<===> options.yml -:todo: - - libsass - <===> input.scss :global(.thing) { color: red; diff --git a/spec/libsass-todo-issues/issue_2818.hrx b/spec/libsass-todo-issues/issue_2818.hrx index 3df4c64f11..4cd1138981 100644 --- a/spec/libsass-todo-issues/issue_2818.hrx +++ b/spec/libsass-todo-issues/issue_2818.hrx @@ -7,5 +7,5 @@ test { color: $base; } <===> output.css test { - color: #e4dede; + color: rgb(228.27, 222.33, 222.33); } diff --git a/spec/libsass/bourbon.hrx b/spec/libsass/bourbon.hrx index a6562240b2..33b675db8e 100644 --- a/spec/libsass/bourbon.hrx +++ b/spec/libsass/bourbon.hrx @@ -1,10 +1,6 @@ <===> options.yml - :todo: -# This file starts failing when split, sass compiler seems to struggle when -# `input.scss` is a real file with `@import "a/b/c"` and `a/b` is actually an -# HRX file containing `c` in its root. -- lint-hrx + - lint-hrx <===> input.scss @use "sass:color"; @@ -1929,8 +1925,8 @@ div { background-image: url("/images/a.png"), url("images/b.png"); background-image: url("/images/a.png"), -webkit-linear-gradient(white 0, yellow 50%, transparent 50%); background-image: url("/images/a.png"), linear-gradient( white 0, yellow 50%, transparent 50%); - background-image: -webkit-linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), -webkit-linear-gradient(#4e7ba3, #3e6181); - background-image: linear-gradient( hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient( #4e7ba3, #3e6181); + background-image: -webkit-linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), -webkit-linear-gradient(#4e7ba3, rgb(61.5619834711, 97.0785123967, 129.4380165289)); + background-image: linear-gradient( hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient( #4e7ba3, rgb(61.5619834711, 97.0785123967, 129.4380165289)); background-image: -webkit-url("/images/a.png")-gradient(center), -webkit-url("images/b.png")-gradient(left); background-image: url("/images/a.png")-gradient( center), url("images/b.png")-gradient( left); } diff --git a/spec/libsass/color-functions/other/change-color/h.hrx b/spec/libsass/color-functions/other/change-color/h.hrx index a27b47e8f1..09bfecd63b 100644 --- a/spec/libsass/color-functions/other/change-color/h.hrx +++ b/spec/libsass/color-functions/other/change-color/h.hrx @@ -367,366 +367,366 @@ foo { <===> output.css foo { - c-1: #ff0004; + c-1: rgb(255, 0, 4.25); c0: red; - c1: #ff0400; - c2: #ff0900; - c3: #ff0d00; + c1: rgb(255, 4.25, 0); + c2: rgb(255, 8.5, 0); + c3: rgb(255, 12.75, 0); c4: #ff1100; - c5: #ff1500; - c6: #ff1a00; - c7: #ff1e00; + c5: rgb(255, 21.25, 0); + c6: rgb(255, 25.5, 0); + c7: rgb(255, 29.75, 0); c8: #ff2200; - c9: #ff2600; - c10: #ff2b00; - c11: #ff2f00; + c9: rgb(255, 38.25, 0); + c10: rgb(255, 42.5, 0); + c11: rgb(255, 46.75, 0); c12: #ff3300; - c13: #ff3700; - c14: #ff3c00; - c15: #ff4000; + c13: rgb(255, 55.25, 0); + c14: rgb(255, 59.5, 0); + c15: rgb(255, 63.75, 0); c16: #ff4400; - c17: #ff4800; - c18: #ff4d00; - c19: #ff5100; + c17: rgb(255, 72.25, 0); + c18: rgb(255, 76.5, 0); + c19: rgb(255, 80.75, 0); c20: #ff5500; - c21: #ff5900; - c22: #ff5e00; - c23: #ff6200; + c21: rgb(255, 89.25, 0); + c22: rgb(255, 93.5, 0); + c23: rgb(255, 97.75, 0); c24: #ff6600; - c25: #ff6a00; - c26: #ff6f00; - c27: #ff7300; + c25: rgb(255, 106.25, 0); + c26: rgb(255, 110.5, 0); + c27: rgb(255, 114.75, 0); c28: #ff7700; - c29: #ff7b00; - c30: #ff8000; - c31: #ff8400; + c29: rgb(255, 123.25, 0); + c30: rgb(255, 127.5, 0); + c31: rgb(255, 131.75, 0); c32: #ff8800; - c33: darkorange; - c34: #ff9100; - c35: #ff9500; + c33: rgb(255, 140.25, 0); + c34: rgb(255, 144.5, 0); + c35: rgb(255, 148.75, 0); c36: #ff9900; - c37: #ff9d00; - c38: #ffa200; - c39: #ffa600; + c37: rgb(255, 157.25, 0); + c38: rgb(255, 161.5, 0); + c39: rgb(255, 165.75, 0); c40: #ffaa00; - c41: #ffae00; - c42: #ffb300; - c43: #ffb700; + c41: rgb(255, 174.25, 0); + c42: rgb(255, 178.5, 0); + c43: rgb(255, 182.75, 0); c44: #ffbb00; - c45: #ffbf00; - c46: #ffc400; - c47: #ffc800; + c45: rgb(255, 191.25, 0); + c46: rgb(255, 195.5, 0); + c47: rgb(255, 199.75, 0); c48: #ffcc00; - c49: #ffd000; - c50: #ffd500; - c51: #ffd900; + c49: rgb(255, 208.25, 0); + c50: rgb(255, 212.5, 0); + c51: rgb(255, 216.75, 0); c52: #ffdd00; - c53: #ffe100; - c54: #ffe600; - c55: #ffea00; + c53: rgb(255, 225.25, 0); + c54: rgb(255, 229.5, 0); + c55: rgb(255, 233.75, 0); c56: #ffee00; - c57: #fff200; - c58: #fff700; - c59: #fffb00; + c57: rgb(255, 242.25, 0); + c58: rgb(255, 246.5, 0); + c59: rgb(255, 250.75, 0); c60: yellow; - c61: #fbff00; - c62: #f7ff00; - c63: #f2ff00; + c61: rgb(250.75, 255, 0); + c62: rgb(246.5, 255, 0); + c63: rgb(242.25, 255, 0); c64: #eeff00; - c65: #eaff00; - c66: #e6ff00; - c67: #e1ff00; + c65: rgb(233.75, 255, 0); + c66: rgb(229.5, 255, 0); + c67: rgb(225.25, 255, 0); c68: #ddff00; - c69: #d9ff00; - c70: #d5ff00; - c71: #d0ff00; + c69: rgb(216.75, 255, 0); + c70: rgb(212.5, 255, 0); + c71: rgb(208.25, 255, 0); c72: #ccff00; - c73: #c8ff00; - c74: #c4ff00; - c75: #bfff00; + c73: rgb(199.75, 255, 0); + c74: rgb(195.5, 255, 0); + c75: rgb(191.25, 255, 0); c76: #bbff00; - c77: #b7ff00; - c78: #b3ff00; - c79: #aeff00; + c77: rgb(182.75, 255, 0); + c78: rgb(178.5, 255, 0); + c79: rgb(174.25, 255, 0); c80: #aaff00; - c81: #a6ff00; - c82: #a2ff00; - c83: #9dff00; + c81: rgb(165.75, 255, 0); + c82: rgb(161.5, 255, 0); + c83: rgb(157.25, 255, 0); c84: #99ff00; - c85: #95ff00; - c86: #91ff00; - c87: #8cff00; + c85: rgb(148.75, 255, 0); + c86: rgb(144.5, 255, 0); + c87: rgb(140.25, 255, 0); c88: #88ff00; - c89: #84ff00; - c90: #80ff00; - c91: #7bff00; + c89: rgb(131.75, 255, 0); + c90: rgb(127.5, 255, 0); + c91: rgb(123.25, 255, 0); c92: #77ff00; - c93: #73ff00; - c94: #6fff00; - c95: #6aff00; + c93: rgb(114.75, 255, 0); + c94: rgb(110.5, 255, 0); + c95: rgb(106.25, 255, 0); c96: #66ff00; - c97: #62ff00; - c98: #5eff00; - c99: #59ff00; + c97: rgb(97.75, 255, 0); + c98: rgb(93.5, 255, 0); + c99: rgb(89.25, 255, 0); c100: #55ff00; - c101: #51ff00; - c102: #4dff00; - c103: #48ff00; + c101: rgb(80.75, 255, 0); + c102: rgb(76.5, 255, 0); + c103: rgb(72.25, 255, 0); c104: #44ff00; - c105: #40ff00; - c106: #3cff00; - c107: #37ff00; + c105: rgb(63.75, 255, 0); + c106: rgb(59.5, 255, 0); + c107: rgb(55.25, 255, 0); c108: #33ff00; - c109: #2fff00; - c110: #2bff00; - c111: #26ff00; + c109: rgb(46.75, 255, 0); + c110: rgb(42.5, 255, 0); + c111: rgb(38.25, 255, 0); c112: #22ff00; - c113: #1eff00; - c114: #1aff00; - c115: #15ff00; + c113: rgb(29.75, 255, 0); + c114: rgb(25.5, 255, 0); + c115: rgb(21.25, 255, 0); c116: #11ff00; - c117: #0dff00; - c118: #09ff00; - c119: #04ff00; + c117: rgb(12.75, 255, 0); + c118: rgb(8.5, 255, 0); + c119: rgb(4.25, 255, 0); c120: lime; - c121: #00ff04; - c122: #00ff09; - c123: #00ff0d; + c121: rgb(0, 255, 4.25); + c122: rgb(0, 255, 8.5); + c123: rgb(0, 255, 12.75); c124: #00ff11; - c125: #00ff15; - c126: #00ff1a; - c127: #00ff1e; + c125: rgb(0, 255, 21.25); + c126: rgb(0, 255, 25.5); + c127: rgb(0, 255, 29.75); c128: #00ff22; - c129: #00ff26; - c130: #00ff2b; - c131: #00ff2f; + c129: rgb(0, 255, 38.25); + c130: rgb(0, 255, 42.5); + c131: rgb(0, 255, 46.75); c132: #00ff33; - c133: #00ff37; - c134: #00ff3c; - c135: #00ff40; + c133: rgb(0, 255, 55.25); + c134: rgb(0, 255, 59.5); + c135: rgb(0, 255, 63.75); c136: #00ff44; - c137: #00ff48; - c138: #00ff4d; - c139: #00ff51; + c137: rgb(0, 255, 72.25); + c138: rgb(0, 255, 76.5); + c139: rgb(0, 255, 80.75); c140: #00ff55; - c141: #00ff59; - c142: #00ff5e; - c143: #00ff62; + c141: rgb(0, 255, 89.25); + c142: rgb(0, 255, 93.5); + c143: rgb(0, 255, 97.75); c144: #00ff66; - c145: #00ff6a; - c146: #00ff6f; - c147: #00ff73; + c145: rgb(0, 255, 106.25); + c146: rgb(0, 255, 110.5); + c147: rgb(0, 255, 114.75); c148: #00ff77; - c149: #00ff7b; - c150: #00ff80; - c151: #00ff84; + c149: rgb(0, 255, 123.25); + c150: rgb(0, 255, 127.5); + c151: rgb(0, 255, 131.75); c152: #00ff88; - c153: #00ff8c; - c154: #00ff91; - c155: #00ff95; + c153: rgb(0, 255, 140.25); + c154: rgb(0, 255, 144.5); + c155: rgb(0, 255, 148.75); c156: #00ff99; - c157: #00ff9d; - c158: #00ffa2; - c159: #00ffa6; + c157: rgb(0, 255, 157.25); + c158: rgb(0, 255, 161.5); + c159: rgb(0, 255, 165.75); c160: #00ffaa; - c161: #00ffae; - c162: #00ffb3; - c163: #00ffb7; + c161: rgb(0, 255, 174.25); + c162: rgb(0, 255, 178.5); + c163: rgb(0, 255, 182.75); c164: #00ffbb; - c165: #00ffbf; - c166: #00ffc4; - c167: #00ffc8; + c165: rgb(0, 255, 191.25); + c166: rgb(0, 255, 195.5); + c167: rgb(0, 255, 199.75); c168: #00ffcc; - c169: #00ffd0; - c170: #00ffd5; - c171: #00ffd9; + c169: rgb(0, 255, 208.25); + c170: rgb(0, 255, 212.5); + c171: rgb(0, 255, 216.75); c172: #00ffdd; - c173: #00ffe1; - c174: #00ffe6; - c175: #00ffea; + c173: rgb(0, 255, 225.25); + c174: rgb(0, 255, 229.5); + c175: rgb(0, 255, 233.75); c176: #00ffee; - c177: #00fff2; - c178: #00fff7; - c179: #00fffb; + c177: rgb(0, 255, 242.25); + c178: rgb(0, 255, 246.5); + c179: rgb(0, 255, 250.75); c180: aqua; - c181: #00fbff; - c182: #00f7ff; - c183: #00f2ff; + c181: rgb(0, 250.75, 255); + c182: rgb(0, 246.5, 255); + c183: rgb(0, 242.25, 255); c184: #00eeff; - c185: #00eaff; - c186: #00e6ff; - c187: #00e1ff; + c185: rgb(0, 233.75, 255); + c186: rgb(0, 229.5, 255); + c187: rgb(0, 225.25, 255); c188: #00ddff; - c189: #00d9ff; - c190: #00d5ff; - c191: #00d0ff; + c189: rgb(0, 216.75, 255); + c190: rgb(0, 212.5, 255); + c191: rgb(0, 208.25, 255); c192: #00ccff; - c193: #00c8ff; - c194: #00c4ff; - c195: deepskyblue; + c193: rgb(0, 199.75, 255); + c194: rgb(0, 195.5, 255); + c195: rgb(0, 191.25, 255); c196: #00bbff; - c197: #00b7ff; - c198: #00b3ff; - c199: #00aeff; + c197: rgb(0, 182.75, 255); + c198: rgb(0, 178.5, 255); + c199: rgb(0, 174.25, 255); c200: #00aaff; - c201: #00a6ff; - c202: #00a2ff; - c203: #009dff; + c201: rgb(0, 165.75, 255); + c202: rgb(0, 161.5, 255); + c203: rgb(0, 157.25, 255); c204: #0099ff; - c205: #0095ff; - c206: #0091ff; - c207: #008cff; + c205: rgb(0, 148.75, 255); + c206: rgb(0, 144.5, 255); + c207: rgb(0, 140.25, 255); c208: #0088ff; - c209: #0084ff; - c210: #0080ff; - c211: #007bff; + c209: rgb(0, 131.75, 255); + c210: rgb(0, 127.5, 255); + c211: rgb(0, 123.25, 255); c212: #0077ff; - c213: #0073ff; - c214: #006fff; - c215: #006aff; + c213: rgb(0, 114.75, 255); + c214: rgb(0, 110.5, 255); + c215: rgb(0, 106.25, 255); c216: #0066ff; - c217: #0062ff; - c218: #005eff; - c219: #0059ff; + c217: rgb(0, 97.75, 255); + c218: rgb(0, 93.5, 255); + c219: rgb(0, 89.25, 255); c220: #0055ff; - c221: #0051ff; - c222: #004dff; - c223: #0048ff; + c221: rgb(0, 80.75, 255); + c222: rgb(0, 76.5, 255); + c223: rgb(0, 72.25, 255); c224: #0044ff; - c225: #0040ff; - c226: #003cff; - c227: #0037ff; + c225: rgb(0, 63.75, 255); + c226: rgb(0, 59.5, 255); + c227: rgb(0, 55.25, 255); c228: #0033ff; - c229: #002fff; - c230: #002bff; - c231: #0026ff; + c229: rgb(0, 46.75, 255); + c230: rgb(0, 42.5, 255); + c231: rgb(0, 38.25, 255); c232: #0022ff; - c233: #001eff; - c234: #001aff; - c235: #0015ff; + c233: rgb(0, 29.75, 255); + c234: rgb(0, 25.5, 255); + c235: rgb(0, 21.25, 255); c236: #0011ff; - c237: #000dff; - c238: #0009ff; - c239: #0004ff; + c237: rgb(0, 12.75, 255); + c238: rgb(0, 8.5, 255); + c239: rgb(0, 4.25, 255); c240: blue; - c241: #0400ff; - c242: #0900ff; - c243: #0d00ff; + c241: rgb(4.25, 0, 255); + c242: rgb(8.5, 0, 255); + c243: rgb(12.75, 0, 255); c244: #1100ff; - c245: #1500ff; - c246: #1a00ff; - c247: #1e00ff; + c245: rgb(21.25, 0, 255); + c246: rgb(25.5, 0, 255); + c247: rgb(29.75, 0, 255); c248: #2200ff; - c249: #2600ff; - c250: #2b00ff; - c251: #2f00ff; + c249: rgb(38.25, 0, 255); + c250: rgb(42.5, 0, 255); + c251: rgb(46.75, 0, 255); c252: #3300ff; - c253: #3700ff; - c254: #3c00ff; - c255: #4000ff; + c253: rgb(55.25, 0, 255); + c254: rgb(59.5, 0, 255); + c255: rgb(63.75, 0, 255); c256: #4400ff; - c257: #4800ff; - c258: #4d00ff; - c259: #5100ff; + c257: rgb(72.25, 0, 255); + c258: rgb(76.5, 0, 255); + c259: rgb(80.75, 0, 255); c260: #5500ff; - c261: #5900ff; - c262: #5e00ff; - c263: #6200ff; + c261: rgb(89.25, 0, 255); + c262: rgb(93.5, 0, 255); + c263: rgb(97.75, 0, 255); c264: #6600ff; - c265: #6a00ff; - c266: #6f00ff; - c267: #7300ff; + c265: rgb(106.25, 0, 255); + c266: rgb(110.5, 0, 255); + c267: rgb(114.75, 0, 255); c268: #7700ff; - c269: #7b00ff; - c270: #8000ff; - c271: #8400ff; + c269: rgb(123.25, 0, 255); + c270: rgb(127.5, 0, 255); + c271: rgb(131.75, 0, 255); c272: #8800ff; - c273: #8c00ff; - c274: #9100ff; - c275: #9500ff; + c273: rgb(140.25, 0, 255); + c274: rgb(144.5, 0, 255); + c275: rgb(148.75, 0, 255); c276: #9900ff; - c277: #9d00ff; - c278: #a200ff; - c279: #a600ff; + c277: rgb(157.25, 0, 255); + c278: rgb(161.5, 0, 255); + c279: rgb(165.75, 0, 255); c280: #aa00ff; - c281: #ae00ff; - c282: #b300ff; - c283: #b700ff; + c281: rgb(174.25, 0, 255); + c282: rgb(178.5, 0, 255); + c283: rgb(182.75, 0, 255); c284: #bb00ff; - c285: #bf00ff; - c286: #c400ff; - c287: #c800ff; + c285: rgb(191.25, 0, 255); + c286: rgb(195.5, 0, 255); + c287: rgb(199.75, 0, 255); c288: #cc00ff; - c289: #d000ff; - c290: #d500ff; - c291: #d900ff; + c289: rgb(208.25, 0, 255); + c290: rgb(212.5, 0, 255); + c291: rgb(216.75, 0, 255); c292: #dd00ff; - c293: #e100ff; - c294: #e600ff; - c295: #ea00ff; + c293: rgb(225.25, 0, 255); + c294: rgb(229.5, 0, 255); + c295: rgb(233.75, 0, 255); c296: #ee00ff; - c297: #f200ff; - c298: #f700ff; - c299: #fb00ff; + c297: rgb(242.25, 0, 255); + c298: rgb(246.5, 0, 255); + c299: rgb(250.75, 0, 255); c300: fuchsia; - c301: #ff00fb; - c302: #ff00f7; - c303: #ff00f2; + c301: rgb(255, 0, 250.75); + c302: rgb(255, 0, 246.5); + c303: rgb(255, 0, 242.25); c304: #ff00ee; - c305: #ff00ea; - c306: #ff00e6; - c307: #ff00e1; + c305: rgb(255, 0, 233.75); + c306: rgb(255, 0, 229.5); + c307: rgb(255, 0, 225.25); c308: #ff00dd; - c309: #ff00d9; - c310: #ff00d5; - c311: #ff00d0; + c309: rgb(255, 0, 216.75); + c310: rgb(255, 0, 212.5); + c311: rgb(255, 0, 208.25); c312: #ff00cc; - c313: #ff00c8; - c314: #ff00c4; - c315: #ff00bf; + c313: rgb(255, 0, 199.75); + c314: rgb(255, 0, 195.5); + c315: rgb(255, 0, 191.25); c316: #ff00bb; - c317: #ff00b7; - c318: #ff00b3; - c319: #ff00ae; + c317: rgb(255, 0, 182.75); + c318: rgb(255, 0, 178.5); + c319: rgb(255, 0, 174.25); c320: #ff00aa; - c321: #ff00a6; - c322: #ff00a2; - c323: #ff009d; + c321: rgb(255, 0, 165.75); + c322: rgb(255, 0, 161.5); + c323: rgb(255, 0, 157.25); c324: #ff0099; - c325: #ff0095; - c326: #ff0091; - c327: #ff008c; + c325: rgb(255, 0, 148.75); + c326: rgb(255, 0, 144.5); + c327: rgb(255, 0, 140.25); c328: #ff0088; - c329: #ff0084; - c330: #ff0080; - c331: #ff007b; + c329: rgb(255, 0, 131.75); + c330: rgb(255, 0, 127.5); + c331: rgb(255, 0, 123.25); c332: #ff0077; - c333: #ff0073; - c334: #ff006f; - c335: #ff006a; + c333: rgb(255, 0, 114.75); + c334: rgb(255, 0, 110.5); + c335: rgb(255, 0, 106.25); c336: #ff0066; - c337: #ff0062; - c338: #ff005e; - c339: #ff0059; + c337: rgb(255, 0, 97.75); + c338: rgb(255, 0, 93.5); + c339: rgb(255, 0, 89.25); c340: #ff0055; - c341: #ff0051; - c342: #ff004d; - c343: #ff0048; + c341: rgb(255, 0, 80.75); + c342: rgb(255, 0, 76.5); + c343: rgb(255, 0, 72.25); c344: #ff0044; - c345: #ff0040; - c346: #ff003c; - c347: #ff0037; + c345: rgb(255, 0, 63.75); + c346: rgb(255, 0, 59.5); + c347: rgb(255, 0, 55.25); c348: #ff0033; - c349: #ff002f; - c350: #ff002b; - c351: #ff0026; + c349: rgb(255, 0, 46.75); + c350: rgb(255, 0, 42.5); + c351: rgb(255, 0, 38.25); c352: #ff0022; - c353: #ff001e; - c354: #ff001a; - c355: #ff0015; + c353: rgb(255, 0, 29.75); + c354: rgb(255, 0, 25.5); + c355: rgb(255, 0, 21.25); c356: #ff0011; - c357: #ff000d; - c358: #ff0009; - c359: #ff0004; + c357: rgb(255, 0, 12.75); + c358: rgb(255, 0, 8.5); + c359: rgb(255, 0, 4.25); c360: red; } diff --git a/spec/libsass/color-functions/other/change-color/l.hrx b/spec/libsass/color-functions/other/change-color/l.hrx index 91cb56c512..d10346a171 100644 --- a/spec/libsass/color-functions/other/change-color/l.hrx +++ b/spec/libsass/color-functions/other/change-color/l.hrx @@ -108,103 +108,103 @@ foo { <===> output.css foo { c0: black; - c1: #050000; - c2: #0a0000; - c3: #0f0000; - c4: #140000; - c5: #1a0000; - c6: #1f0000; - c7: #240000; - c8: #290000; - c9: #2e0000; + c1: rgb(5.1, 0, 0); + c2: rgb(10.2, 0, 0); + c3: rgb(15.3, 0, 0); + c4: rgb(20.4, 0, 0); + c5: rgb(25.5, 0, 0); + c6: rgb(30.6, 0, 0); + c7: rgb(35.7, 0, 0); + c8: rgb(40.8, 0, 0); + c9: rgb(45.9, 0, 0); c10: #330000; - c11: #380000; - c12: #3d0000; - c13: #420000; - c14: #470000; - c15: #4d0000; - c16: #520000; - c17: #570000; - c18: #5c0000; - c19: #610000; + c11: rgb(56.1, 0, 0); + c12: rgb(61.2, 0, 0); + c13: rgb(66.3, 0, 0); + c14: rgb(71.4, 0, 0); + c15: rgb(76.5, 0, 0); + c16: rgb(81.6, 0, 0); + c17: rgb(86.7, 0, 0); + c18: rgb(91.8, 0, 0); + c19: rgb(96.9, 0, 0); c20: #660000; - c21: #6b0000; - c22: #700000; - c23: #750000; - c24: #7a0000; - c25: maroon; - c26: #850000; - c27: #8a0000; - c28: #8f0000; - c29: #940000; + c21: rgb(107.1, 0, 0); + c22: rgb(112.2, 0, 0); + c23: rgb(117.3, 0, 0); + c24: rgb(122.4, 0, 0); + c25: rgb(127.5, 0, 0); + c26: rgb(132.6, 0, 0); + c27: rgb(137.7, 0, 0); + c28: rgb(142.8, 0, 0); + c29: rgb(147.9, 0, 0); c30: #990000; - c31: #9e0000; - c32: #a30000; - c33: #a80000; - c34: #ad0000; - c35: #b30000; - c36: #b80000; - c37: #bd0000; - c38: #c20000; - c39: #c70000; + c31: rgb(158.1, 0, 0); + c32: rgb(163.2, 0, 0); + c33: rgb(168.3, 0, 0); + c34: rgb(173.4, 0, 0); + c35: rgb(178.5, 0, 0); + c36: rgb(183.6, 0, 0); + c37: rgb(188.7, 0, 0); + c38: rgb(193.8, 0, 0); + c39: rgb(198.9, 0, 0); c40: #cc0000; - c41: #d10000; - c42: #d60000; - c43: #db0000; - c44: #e00000; - c45: #e60000; - c46: #eb0000; - c47: #f00000; - c48: #f50000; - c49: #fa0000; + c41: rgb(209.1, 0, 0); + c42: rgb(214.2, 0, 0); + c43: rgb(219.3, 0, 0); + c44: rgb(224.4, 0, 0); + c45: rgb(229.5, 0, 0); + c46: rgb(234.6, 0, 0); + c47: rgb(239.7, 0, 0); + c48: rgb(244.8, 0, 0); + c49: rgb(249.9, 0, 0); c50: red; - c51: #ff0505; - c52: #ff0a0a; - c53: #ff0f0f; - c54: #ff1414; - c55: #ff1a1a; - c56: #ff1f1f; - c57: #ff2424; - c58: #ff2929; - c59: #ff2e2e; + c51: rgb(255, 5.1, 5.1); + c52: rgb(255, 10.2, 10.2); + c53: rgb(255, 15.3, 15.3); + c54: rgb(255, 20.4, 20.4); + c55: rgb(255, 25.5, 25.5); + c56: rgb(255, 30.6, 30.6); + c57: rgb(255, 35.7, 35.7); + c58: rgb(255, 40.8, 40.8); + c59: rgb(255, 45.9, 45.9); c60: #ff3333; - c61: #ff3838; - c62: #ff3d3d; - c63: #ff4242; - c64: #ff4747; - c65: #ff4d4d; - c66: #ff5252; - c67: #ff5757; - c68: #ff5c5c; - c69: #ff6161; + c61: rgb(255, 56.1, 56.1); + c62: rgb(255, 61.2, 61.2); + c63: rgb(255, 66.3, 66.3); + c64: rgb(255, 71.4, 71.4); + c65: rgb(255, 76.5, 76.5); + c66: rgb(255, 81.6, 81.6); + c67: rgb(255, 86.7, 86.7); + c68: rgb(255, 91.8, 91.8); + c69: rgb(255, 96.9, 96.9); c70: #ff6666; - c71: #ff6b6b; - c72: #ff7070; - c73: #ff7575; - c74: #ff7a7a; - c75: #ff8080; - c76: #ff8585; - c77: #ff8a8a; - c78: #ff8f8f; - c79: #ff9494; + c71: rgb(255, 107.1, 107.1); + c72: rgb(255, 112.2, 112.2); + c73: rgb(255, 117.3, 117.3); + c74: rgb(255, 122.4, 122.4); + c75: rgb(255, 127.5, 127.5); + c76: rgb(255, 132.6, 132.6); + c77: rgb(255, 137.7, 137.7); + c78: rgb(255, 142.8, 142.8); + c79: rgb(255, 147.9, 147.9); c80: #ff9999; - c81: #ff9e9e; - c82: #ffa3a3; - c83: #ffa8a8; - c84: #ffadad; - c85: #ffb3b3; - c86: #ffb8b8; - c87: #ffbdbd; - c88: #ffc2c2; - c89: #ffc7c7; + c81: rgb(255, 158.1, 158.1); + c82: rgb(255, 163.2, 163.2); + c83: rgb(255, 168.3, 168.3); + c84: rgb(255, 173.4, 173.4); + c85: rgb(255, 178.5, 178.5); + c86: rgb(255, 183.6, 183.6); + c87: rgb(255, 188.7, 188.7); + c88: rgb(255, 193.8, 193.8); + c89: rgb(255, 198.9, 198.9); c90: #ffcccc; - c91: #ffd1d1; - c92: #ffd6d6; - c93: #ffdbdb; - c94: #ffe0e0; - c95: #ffe6e6; - c96: #ffebeb; - c97: #fff0f0; - c98: #fff5f5; - c99: snow; + c91: rgb(255, 209.1, 209.1); + c92: rgb(255, 214.2, 214.2); + c93: rgb(255, 219.3, 219.3); + c94: rgb(255, 224.4, 224.4); + c95: rgb(255, 229.5, 229.5); + c96: rgb(255, 234.6, 234.6); + c97: rgb(255, 239.7, 239.7); + c98: rgb(255, 244.8, 244.8); + c99: rgb(255, 249.9, 249.9); } diff --git a/spec/libsass/color-functions/other/change-color/s.hrx b/spec/libsass/color-functions/other/change-color/s.hrx index b67b43d755..6a457f63bd 100644 --- a/spec/libsass/color-functions/other/change-color/s.hrx +++ b/spec/libsass/color-functions/other/change-color/s.hrx @@ -108,105 +108,105 @@ foo { <===> output.css foo { - c0: gray; - c1: #817e7e; - c2: #827d7d; - c3: #837c7c; - c4: #857a7a; - c5: #867979; - c6: #877878; - c7: #887777; - c8: #8a7575; - c9: #8b7474; - c10: #8c7373; - c11: #8e7171; - c12: #8f7070; - c13: #906f6f; - c14: #916e6e; - c15: #936c6c; - c16: #946b6b; - c17: #956a6a; - c18: #966969; - c19: #986767; + c0: rgb(127.5, 127.5, 127.5); + c1: rgb(128.775, 126.225, 126.225); + c2: rgb(130.05, 124.95, 124.95); + c3: rgb(131.325, 123.675, 123.675); + c4: rgb(132.6, 122.4, 122.4); + c5: rgb(133.875, 121.125, 121.125); + c6: rgb(135.15, 119.85, 119.85); + c7: rgb(136.425, 118.575, 118.575); + c8: rgb(137.7, 117.3, 117.3); + c9: rgb(138.975, 116.025, 116.025); + c10: rgb(140.25, 114.75, 114.75); + c11: rgb(141.525, 113.475, 113.475); + c12: rgb(142.8, 112.2, 112.2); + c13: rgb(144.075, 110.925, 110.925); + c14: rgb(145.35, 109.65, 109.65); + c15: rgb(146.625, 108.375, 108.375); + c16: rgb(147.9, 107.1, 107.1); + c17: rgb(149.175, 105.825, 105.825); + c18: rgb(150.45, 104.55, 104.55); + c19: rgb(151.725, 103.275, 103.275); c20: #996666; - c21: #9a6565; - c22: #9c6363; - c23: #9d6262; - c24: #9e6161; - c25: #9f6060; - c26: #a15e5e; - c27: #a25d5d; - c28: #a35c5c; - c29: #a45b5b; - c30: #a65959; - c31: #a75858; - c32: #a85757; - c33: #aa5555; - c34: #ab5454; - c35: #ac5353; - c36: #ad5252; - c37: #af5050; - c38: #b04f4f; - c39: #b14e4e; - c40: #b34d4d; - c41: #b44b4b; - c42: #b54a4a; - c43: #b64949; - c44: #b84747; - c45: #b94646; - c46: #ba4545; - c47: #bb4444; - c48: #bd4242; - c49: #be4141; - c50: #bf4040; - c51: #c13e3e; - c52: #c23d3d; - c53: #c33c3c; - c54: #c43b3b; - c55: #c63939; - c56: #c73838; - c57: #c83737; - c58: #c93636; - c59: #cb3434; + c21: rgb(154.275, 100.725, 100.725); + c22: rgb(155.55, 99.45, 99.45); + c23: rgb(156.825, 98.175, 98.175); + c24: rgb(158.1, 96.9, 96.9); + c25: rgb(159.375, 95.625, 95.625); + c26: rgb(160.65, 94.35, 94.35); + c27: rgb(161.925, 93.075, 93.075); + c28: rgb(163.2, 91.8, 91.8); + c29: rgb(164.475, 90.525, 90.525); + c30: rgb(165.75, 89.25, 89.25); + c31: rgb(167.025, 87.975, 87.975); + c32: rgb(168.3, 86.7, 86.7); + c33: rgb(169.575, 85.425, 85.425); + c34: rgb(170.85, 84.15, 84.15); + c35: rgb(172.125, 82.875, 82.875); + c36: rgb(173.4, 81.6, 81.6); + c37: rgb(174.675, 80.325, 80.325); + c38: rgb(175.95, 79.05, 79.05); + c39: rgb(177.225, 77.775, 77.775); + c40: rgb(178.5, 76.5, 76.5); + c41: rgb(179.775, 75.225, 75.225); + c42: rgb(181.05, 73.95, 73.95); + c43: rgb(182.325, 72.675, 72.675); + c44: rgb(183.6, 71.4, 71.4); + c45: rgb(184.875, 70.125, 70.125); + c46: rgb(186.15, 68.85, 68.85); + c47: rgb(187.425, 67.575, 67.575); + c48: rgb(188.7, 66.3, 66.3); + c49: rgb(189.975, 65.025, 65.025); + c50: rgb(191.25, 63.75, 63.75); + c51: rgb(192.525, 62.475, 62.475); + c52: rgb(193.8, 61.2, 61.2); + c53: rgb(195.075, 59.925, 59.925); + c54: rgb(196.35, 58.65, 58.65); + c55: rgb(197.625, 57.375, 57.375); + c56: rgb(198.9, 56.1, 56.1); + c57: rgb(200.175, 54.825, 54.825); + c58: rgb(201.45, 53.55, 53.55); + c59: rgb(202.725, 52.275, 52.275); c60: #cc3333; - c61: #cd3232; - c62: #cf3030; - c63: #d02f2f; - c64: #d12e2e; - c65: #d22d2d; - c66: #d42b2b; - c67: #d52a2a; - c68: #d62929; - c69: #d72828; - c70: #d92626; - c71: #da2525; - c72: #db2424; - c73: #dd2222; - c74: #de2121; - c75: #df2020; - c76: #e01f1f; - c77: #e21d1d; - c78: #e31c1c; - c79: #e41b1b; - c80: #e61a1a; - c81: #e71818; - c82: #e81717; - c83: #e91616; - c84: #eb1414; - c85: #ec1313; - c86: #ed1212; - c87: #ee1111; - c88: #f00f0f; - c89: #f10e0e; - c90: #f20d0d; - c91: #f40b0b; - c92: #f50a0a; - c93: #f60909; - c94: #f70808; - c95: #f90606; - c96: #fa0505; - c97: #fb0404; - c98: #fc0303; - c99: #fe0101; + c61: rgb(205.275, 49.725, 49.725); + c62: rgb(206.55, 48.45, 48.45); + c63: rgb(207.825, 47.175, 47.175); + c64: rgb(209.1, 45.9, 45.9); + c65: rgb(210.375, 44.625, 44.625); + c66: rgb(211.65, 43.35, 43.35); + c67: rgb(212.925, 42.075, 42.075); + c68: rgb(214.2, 40.8, 40.8); + c69: rgb(215.475, 39.525, 39.525); + c70: rgb(216.75, 38.25, 38.25); + c71: rgb(218.025, 36.975, 36.975); + c72: rgb(219.3, 35.7, 35.7); + c73: rgb(220.575, 34.425, 34.425); + c74: rgb(221.85, 33.15, 33.15); + c75: rgb(223.125, 31.875, 31.875); + c76: rgb(224.4, 30.6, 30.6); + c77: rgb(225.675, 29.325, 29.325); + c78: rgb(226.95, 28.05, 28.05); + c79: rgb(228.225, 26.775, 26.775); + c80: rgb(229.5, 25.5, 25.5); + c81: rgb(230.775, 24.225, 24.225); + c82: rgb(232.05, 22.95, 22.95); + c83: rgb(233.325, 21.675, 21.675); + c84: rgb(234.6, 20.4, 20.4); + c85: rgb(235.875, 19.125, 19.125); + c86: rgb(237.15, 17.85, 17.85); + c87: rgb(238.425, 16.575, 16.575); + c88: rgb(239.7, 15.3, 15.3); + c89: rgb(240.975, 14.025, 14.025); + c90: rgb(242.25, 12.75, 12.75); + c91: rgb(243.525, 11.475, 11.475); + c92: rgb(244.8, 10.2, 10.2); + c93: rgb(246.075, 8.925, 8.925); + c94: rgb(247.35, 7.65, 7.65); + c95: rgb(248.625, 6.375, 6.375); + c96: rgb(249.9, 5.1, 5.1); + c97: rgb(251.175, 3.825, 3.825); + c98: rgb(252.45, 2.55, 2.55); + c99: rgb(253.725, 1.275, 1.275); c100: red; } diff --git a/spec/libsass/color-functions/rgb/rgb/b.hrx b/spec/libsass/color-functions/rgb/rgb/b.hrx index b5286934f8..04fc42ebea 100644 --- a/spec/libsass/color-functions/rgb/rgb/b.hrx +++ b/spec/libsass/color-functions/rgb/rgb/b.hrx @@ -631,105 +631,105 @@ foo { foo { c-1: rgb(0, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(0, 0, 3); - c2: rgb(0, 0, 5); - c3: rgb(0, 0, 8); - c4: rgb(0, 0, 10); - c5: rgb(0, 0, 13); - c6: rgb(0, 0, 15); - c7: rgb(0, 0, 18); - c8: rgb(0, 0, 20); - c9: rgb(0, 0, 23); - c10: rgb(0, 0, 26); - c11: rgb(0, 0, 28); - c12: rgb(0, 0, 31); - c13: rgb(0, 0, 33); - c14: rgb(0, 0, 36); - c15: rgb(0, 0, 38); - c16: rgb(0, 0, 41); - c17: rgb(0, 0, 43); - c18: rgb(0, 0, 46); - c19: rgb(0, 0, 48); + c1: rgb(0, 0, 2.55); + c2: rgb(0, 0, 5.1); + c3: rgb(0, 0, 7.65); + c4: rgb(0, 0, 10.2); + c5: rgb(0, 0, 12.75); + c6: rgb(0, 0, 15.3); + c7: rgb(0, 0, 17.85); + c8: rgb(0, 0, 20.4); + c9: rgb(0, 0, 22.95); + c10: rgb(0, 0, 25.5); + c11: rgb(0, 0, 28.05); + c12: rgb(0, 0, 30.6); + c13: rgb(0, 0, 33.15); + c14: rgb(0, 0, 35.7); + c15: rgb(0, 0, 38.25); + c16: rgb(0, 0, 40.8); + c17: rgb(0, 0, 43.35); + c18: rgb(0, 0, 45.9); + c19: rgb(0, 0, 48.45); c20: rgb(0, 0, 51); - c21: rgb(0, 0, 54); - c22: rgb(0, 0, 56); - c23: rgb(0, 0, 59); - c24: rgb(0, 0, 61); - c25: rgb(0, 0, 64); - c26: rgb(0, 0, 66); - c27: rgb(0, 0, 69); - c28: rgb(0, 0, 71); - c29: rgb(0, 0, 74); - c30: rgb(0, 0, 77); - c31: rgb(0, 0, 79); - c32: rgb(0, 0, 82); - c33: rgb(0, 0, 84); - c34: rgb(0, 0, 87); - c35: rgb(0, 0, 89); - c36: rgb(0, 0, 92); - c37: rgb(0, 0, 94); - c38: rgb(0, 0, 97); - c39: rgb(0, 0, 99); + c21: rgb(0, 0, 53.55); + c22: rgb(0, 0, 56.1); + c23: rgb(0, 0, 58.65); + c24: rgb(0, 0, 61.2); + c25: rgb(0, 0, 63.75); + c26: rgb(0, 0, 66.3); + c27: rgb(0, 0, 68.85); + c28: rgb(0, 0, 71.4); + c29: rgb(0, 0, 73.95); + c30: rgb(0, 0, 76.5); + c31: rgb(0, 0, 79.05); + c32: rgb(0, 0, 81.6); + c33: rgb(0, 0, 84.15); + c34: rgb(0, 0, 86.7); + c35: rgb(0, 0, 89.25); + c36: rgb(0, 0, 91.8); + c37: rgb(0, 0, 94.35); + c38: rgb(0, 0, 96.9); + c39: rgb(0, 0, 99.45); c40: rgb(0, 0, 102); - c41: rgb(0, 0, 105); - c42: rgb(0, 0, 107); - c43: rgb(0, 0, 110); - c44: rgb(0, 0, 112); - c45: rgb(0, 0, 115); - c46: rgb(0, 0, 117); - c47: rgb(0, 0, 120); - c48: rgb(0, 0, 122); - c49: rgb(0, 0, 125); - c50: rgb(0, 0, 128); - c51: rgb(0, 0, 130); - c52: rgb(0, 0, 133); - c53: rgb(0, 0, 135); - c54: rgb(0, 0, 138); - c55: rgb(0, 0, 140); - c56: rgb(0, 0, 143); - c57: rgb(0, 0, 145); - c58: rgb(0, 0, 148); - c59: rgb(0, 0, 150); + c41: rgb(0, 0, 104.55); + c42: rgb(0, 0, 107.1); + c43: rgb(0, 0, 109.65); + c44: rgb(0, 0, 112.2); + c45: rgb(0, 0, 114.75); + c46: rgb(0, 0, 117.3); + c47: rgb(0, 0, 119.85); + c48: rgb(0, 0, 122.4); + c49: rgb(0, 0, 124.95); + c50: rgb(0, 0, 127.5); + c51: rgb(0, 0, 130.05); + c52: rgb(0, 0, 132.6); + c53: rgb(0, 0, 135.15); + c54: rgb(0, 0, 137.7); + c55: rgb(0, 0, 140.25); + c56: rgb(0, 0, 142.8); + c57: rgb(0, 0, 145.35); + c58: rgb(0, 0, 147.9); + c59: rgb(0, 0, 150.45); c60: rgb(0, 0, 153); - c61: rgb(0, 0, 156); - c62: rgb(0, 0, 158); - c63: rgb(0, 0, 161); - c64: rgb(0, 0, 163); - c65: rgb(0, 0, 166); - c66: rgb(0, 0, 168); - c67: rgb(0, 0, 171); - c68: rgb(0, 0, 173); - c69: rgb(0, 0, 176); - c70: rgb(0, 0, 179); - c71: rgb(0, 0, 181); - c72: rgb(0, 0, 184); - c73: rgb(0, 0, 186); - c74: rgb(0, 0, 189); - c75: rgb(0, 0, 191); - c76: rgb(0, 0, 194); - c77: rgb(0, 0, 196); - c78: rgb(0, 0, 199); - c79: rgb(0, 0, 201); + c61: rgb(0, 0, 155.55); + c62: rgb(0, 0, 158.1); + c63: rgb(0, 0, 160.65); + c64: rgb(0, 0, 163.2); + c65: rgb(0, 0, 165.75); + c66: rgb(0, 0, 168.3); + c67: rgb(0, 0, 170.85); + c68: rgb(0, 0, 173.4); + c69: rgb(0, 0, 175.95); + c70: rgb(0, 0, 178.5); + c71: rgb(0, 0, 181.05); + c72: rgb(0, 0, 183.6); + c73: rgb(0, 0, 186.15); + c74: rgb(0, 0, 188.7); + c75: rgb(0, 0, 191.25); + c76: rgb(0, 0, 193.8); + c77: rgb(0, 0, 196.35); + c78: rgb(0, 0, 198.9); + c79: rgb(0, 0, 201.45); c80: rgb(0, 0, 204); - c81: rgb(0, 0, 207); - c82: rgb(0, 0, 209); - c83: rgb(0, 0, 212); - c84: rgb(0, 0, 214); - c85: rgb(0, 0, 217); - c86: rgb(0, 0, 219); - c87: rgb(0, 0, 222); - c88: rgb(0, 0, 224); - c89: rgb(0, 0, 227); - c90: rgb(0, 0, 230); - c91: rgb(0, 0, 232); - c92: rgb(0, 0, 235); - c93: rgb(0, 0, 237); - c94: rgb(0, 0, 240); - c95: rgb(0, 0, 242); - c96: rgb(0, 0, 245); - c97: rgb(0, 0, 247); - c98: rgb(0, 0, 250); - c99: rgb(0, 0, 252); + c81: rgb(0, 0, 206.55); + c82: rgb(0, 0, 209.1); + c83: rgb(0, 0, 211.65); + c84: rgb(0, 0, 214.2); + c85: rgb(0, 0, 216.75); + c86: rgb(0, 0, 219.3); + c87: rgb(0, 0, 221.85); + c88: rgb(0, 0, 224.4); + c89: rgb(0, 0, 226.95); + c90: rgb(0, 0, 229.5); + c91: rgb(0, 0, 232.05); + c92: rgb(0, 0, 234.6); + c93: rgb(0, 0, 237.15); + c94: rgb(0, 0, 239.7); + c95: rgb(0, 0, 242.25); + c96: rgb(0, 0, 244.8); + c97: rgb(0, 0, 247.35); + c98: rgb(0, 0, 249.9); + c99: rgb(0, 0, 252.45); c100: rgb(0, 0, 255); c101: rgb(0, 0, 255); } diff --git a/spec/libsass/color-functions/rgb/rgb/g.hrx b/spec/libsass/color-functions/rgb/rgb/g.hrx index b61523c38e..c9326912fd 100644 --- a/spec/libsass/color-functions/rgb/rgb/g.hrx +++ b/spec/libsass/color-functions/rgb/rgb/g.hrx @@ -631,105 +631,105 @@ foo { foo { c-1: rgb(0, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(0, 3, 0); - c2: rgb(0, 5, 0); - c3: rgb(0, 8, 0); - c4: rgb(0, 10, 0); - c5: rgb(0, 13, 0); - c6: rgb(0, 15, 0); - c7: rgb(0, 18, 0); - c8: rgb(0, 20, 0); - c9: rgb(0, 23, 0); - c10: rgb(0, 26, 0); - c11: rgb(0, 28, 0); - c12: rgb(0, 31, 0); - c13: rgb(0, 33, 0); - c14: rgb(0, 36, 0); - c15: rgb(0, 38, 0); - c16: rgb(0, 41, 0); - c17: rgb(0, 43, 0); - c18: rgb(0, 46, 0); - c19: rgb(0, 48, 0); + c1: rgb(0, 2.55, 0); + c2: rgb(0, 5.1, 0); + c3: rgb(0, 7.65, 0); + c4: rgb(0, 10.2, 0); + c5: rgb(0, 12.75, 0); + c6: rgb(0, 15.3, 0); + c7: rgb(0, 17.85, 0); + c8: rgb(0, 20.4, 0); + c9: rgb(0, 22.95, 0); + c10: rgb(0, 25.5, 0); + c11: rgb(0, 28.05, 0); + c12: rgb(0, 30.6, 0); + c13: rgb(0, 33.15, 0); + c14: rgb(0, 35.7, 0); + c15: rgb(0, 38.25, 0); + c16: rgb(0, 40.8, 0); + c17: rgb(0, 43.35, 0); + c18: rgb(0, 45.9, 0); + c19: rgb(0, 48.45, 0); c20: rgb(0, 51, 0); - c21: rgb(0, 54, 0); - c22: rgb(0, 56, 0); - c23: rgb(0, 59, 0); - c24: rgb(0, 61, 0); - c25: rgb(0, 64, 0); - c26: rgb(0, 66, 0); - c27: rgb(0, 69, 0); - c28: rgb(0, 71, 0); - c29: rgb(0, 74, 0); - c30: rgb(0, 77, 0); - c31: rgb(0, 79, 0); - c32: rgb(0, 82, 0); - c33: rgb(0, 84, 0); - c34: rgb(0, 87, 0); - c35: rgb(0, 89, 0); - c36: rgb(0, 92, 0); - c37: rgb(0, 94, 0); - c38: rgb(0, 97, 0); - c39: rgb(0, 99, 0); + c21: rgb(0, 53.55, 0); + c22: rgb(0, 56.1, 0); + c23: rgb(0, 58.65, 0); + c24: rgb(0, 61.2, 0); + c25: rgb(0, 63.75, 0); + c26: rgb(0, 66.3, 0); + c27: rgb(0, 68.85, 0); + c28: rgb(0, 71.4, 0); + c29: rgb(0, 73.95, 0); + c30: rgb(0, 76.5, 0); + c31: rgb(0, 79.05, 0); + c32: rgb(0, 81.6, 0); + c33: rgb(0, 84.15, 0); + c34: rgb(0, 86.7, 0); + c35: rgb(0, 89.25, 0); + c36: rgb(0, 91.8, 0); + c37: rgb(0, 94.35, 0); + c38: rgb(0, 96.9, 0); + c39: rgb(0, 99.45, 0); c40: rgb(0, 102, 0); - c41: rgb(0, 105, 0); - c42: rgb(0, 107, 0); - c43: rgb(0, 110, 0); - c44: rgb(0, 112, 0); - c45: rgb(0, 115, 0); - c46: rgb(0, 117, 0); - c47: rgb(0, 120, 0); - c48: rgb(0, 122, 0); - c49: rgb(0, 125, 0); - c50: rgb(0, 128, 0); - c51: rgb(0, 130, 0); - c52: rgb(0, 133, 0); - c53: rgb(0, 135, 0); - c54: rgb(0, 138, 0); - c55: rgb(0, 140, 0); - c56: rgb(0, 143, 0); - c57: rgb(0, 145, 0); - c58: rgb(0, 148, 0); - c59: rgb(0, 150, 0); + c41: rgb(0, 104.55, 0); + c42: rgb(0, 107.1, 0); + c43: rgb(0, 109.65, 0); + c44: rgb(0, 112.2, 0); + c45: rgb(0, 114.75, 0); + c46: rgb(0, 117.3, 0); + c47: rgb(0, 119.85, 0); + c48: rgb(0, 122.4, 0); + c49: rgb(0, 124.95, 0); + c50: rgb(0, 127.5, 0); + c51: rgb(0, 130.05, 0); + c52: rgb(0, 132.6, 0); + c53: rgb(0, 135.15, 0); + c54: rgb(0, 137.7, 0); + c55: rgb(0, 140.25, 0); + c56: rgb(0, 142.8, 0); + c57: rgb(0, 145.35, 0); + c58: rgb(0, 147.9, 0); + c59: rgb(0, 150.45, 0); c60: rgb(0, 153, 0); - c61: rgb(0, 156, 0); - c62: rgb(0, 158, 0); - c63: rgb(0, 161, 0); - c64: rgb(0, 163, 0); - c65: rgb(0, 166, 0); - c66: rgb(0, 168, 0); - c67: rgb(0, 171, 0); - c68: rgb(0, 173, 0); - c69: rgb(0, 176, 0); - c70: rgb(0, 179, 0); - c71: rgb(0, 181, 0); - c72: rgb(0, 184, 0); - c73: rgb(0, 186, 0); - c74: rgb(0, 189, 0); - c75: rgb(0, 191, 0); - c76: rgb(0, 194, 0); - c77: rgb(0, 196, 0); - c78: rgb(0, 199, 0); - c79: rgb(0, 201, 0); + c61: rgb(0, 155.55, 0); + c62: rgb(0, 158.1, 0); + c63: rgb(0, 160.65, 0); + c64: rgb(0, 163.2, 0); + c65: rgb(0, 165.75, 0); + c66: rgb(0, 168.3, 0); + c67: rgb(0, 170.85, 0); + c68: rgb(0, 173.4, 0); + c69: rgb(0, 175.95, 0); + c70: rgb(0, 178.5, 0); + c71: rgb(0, 181.05, 0); + c72: rgb(0, 183.6, 0); + c73: rgb(0, 186.15, 0); + c74: rgb(0, 188.7, 0); + c75: rgb(0, 191.25, 0); + c76: rgb(0, 193.8, 0); + c77: rgb(0, 196.35, 0); + c78: rgb(0, 198.9, 0); + c79: rgb(0, 201.45, 0); c80: rgb(0, 204, 0); - c81: rgb(0, 207, 0); - c82: rgb(0, 209, 0); - c83: rgb(0, 212, 0); - c84: rgb(0, 214, 0); - c85: rgb(0, 217, 0); - c86: rgb(0, 219, 0); - c87: rgb(0, 222, 0); - c88: rgb(0, 224, 0); - c89: rgb(0, 227, 0); - c90: rgb(0, 230, 0); - c91: rgb(0, 232, 0); - c92: rgb(0, 235, 0); - c93: rgb(0, 237, 0); - c94: rgb(0, 240, 0); - c95: rgb(0, 242, 0); - c96: rgb(0, 245, 0); - c97: rgb(0, 247, 0); - c98: rgb(0, 250, 0); - c99: rgb(0, 252, 0); + c81: rgb(0, 206.55, 0); + c82: rgb(0, 209.1, 0); + c83: rgb(0, 211.65, 0); + c84: rgb(0, 214.2, 0); + c85: rgb(0, 216.75, 0); + c86: rgb(0, 219.3, 0); + c87: rgb(0, 221.85, 0); + c88: rgb(0, 224.4, 0); + c89: rgb(0, 226.95, 0); + c90: rgb(0, 229.5, 0); + c91: rgb(0, 232.05, 0); + c92: rgb(0, 234.6, 0); + c93: rgb(0, 237.15, 0); + c94: rgb(0, 239.7, 0); + c95: rgb(0, 242.25, 0); + c96: rgb(0, 244.8, 0); + c97: rgb(0, 247.35, 0); + c98: rgb(0, 249.9, 0); + c99: rgb(0, 252.45, 0); c100: rgb(0, 255, 0); c101: rgb(0, 255, 0); } diff --git a/spec/libsass/color-functions/rgb/rgb/r.hrx b/spec/libsass/color-functions/rgb/rgb/r.hrx index 0cf1e4370a..2f28b4a412 100644 --- a/spec/libsass/color-functions/rgb/rgb/r.hrx +++ b/spec/libsass/color-functions/rgb/rgb/r.hrx @@ -631,105 +631,105 @@ foo { foo { c-1: rgb(0, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(3, 0, 0); - c2: rgb(5, 0, 0); - c3: rgb(8, 0, 0); - c4: rgb(10, 0, 0); - c5: rgb(13, 0, 0); - c6: rgb(15, 0, 0); - c7: rgb(18, 0, 0); - c8: rgb(20, 0, 0); - c9: rgb(23, 0, 0); - c10: rgb(26, 0, 0); - c11: rgb(28, 0, 0); - c12: rgb(31, 0, 0); - c13: rgb(33, 0, 0); - c14: rgb(36, 0, 0); - c15: rgb(38, 0, 0); - c16: rgb(41, 0, 0); - c17: rgb(43, 0, 0); - c18: rgb(46, 0, 0); - c19: rgb(48, 0, 0); + c1: rgb(2.55, 0, 0); + c2: rgb(5.1, 0, 0); + c3: rgb(7.65, 0, 0); + c4: rgb(10.2, 0, 0); + c5: rgb(12.75, 0, 0); + c6: rgb(15.3, 0, 0); + c7: rgb(17.85, 0, 0); + c8: rgb(20.4, 0, 0); + c9: rgb(22.95, 0, 0); + c10: rgb(25.5, 0, 0); + c11: rgb(28.05, 0, 0); + c12: rgb(30.6, 0, 0); + c13: rgb(33.15, 0, 0); + c14: rgb(35.7, 0, 0); + c15: rgb(38.25, 0, 0); + c16: rgb(40.8, 0, 0); + c17: rgb(43.35, 0, 0); + c18: rgb(45.9, 0, 0); + c19: rgb(48.45, 0, 0); c20: rgb(51, 0, 0); - c21: rgb(54, 0, 0); - c22: rgb(56, 0, 0); - c23: rgb(59, 0, 0); - c24: rgb(61, 0, 0); - c25: rgb(64, 0, 0); - c26: rgb(66, 0, 0); - c27: rgb(69, 0, 0); - c28: rgb(71, 0, 0); - c29: rgb(74, 0, 0); - c30: rgb(77, 0, 0); - c31: rgb(79, 0, 0); - c32: rgb(82, 0, 0); - c33: rgb(84, 0, 0); - c34: rgb(87, 0, 0); - c35: rgb(89, 0, 0); - c36: rgb(92, 0, 0); - c37: rgb(94, 0, 0); - c38: rgb(97, 0, 0); - c39: rgb(99, 0, 0); + c21: rgb(53.55, 0, 0); + c22: rgb(56.1, 0, 0); + c23: rgb(58.65, 0, 0); + c24: rgb(61.2, 0, 0); + c25: rgb(63.75, 0, 0); + c26: rgb(66.3, 0, 0); + c27: rgb(68.85, 0, 0); + c28: rgb(71.4, 0, 0); + c29: rgb(73.95, 0, 0); + c30: rgb(76.5, 0, 0); + c31: rgb(79.05, 0, 0); + c32: rgb(81.6, 0, 0); + c33: rgb(84.15, 0, 0); + c34: rgb(86.7, 0, 0); + c35: rgb(89.25, 0, 0); + c36: rgb(91.8, 0, 0); + c37: rgb(94.35, 0, 0); + c38: rgb(96.9, 0, 0); + c39: rgb(99.45, 0, 0); c40: rgb(102, 0, 0); - c41: rgb(105, 0, 0); - c42: rgb(107, 0, 0); - c43: rgb(110, 0, 0); - c44: rgb(112, 0, 0); - c45: rgb(115, 0, 0); - c46: rgb(117, 0, 0); - c47: rgb(120, 0, 0); - c48: rgb(122, 0, 0); - c49: rgb(125, 0, 0); - c50: rgb(128, 0, 0); - c51: rgb(130, 0, 0); - c52: rgb(133, 0, 0); - c53: rgb(135, 0, 0); - c54: rgb(138, 0, 0); - c55: rgb(140, 0, 0); - c56: rgb(143, 0, 0); - c57: rgb(145, 0, 0); - c58: rgb(148, 0, 0); - c59: rgb(150, 0, 0); + c41: rgb(104.55, 0, 0); + c42: rgb(107.1, 0, 0); + c43: rgb(109.65, 0, 0); + c44: rgb(112.2, 0, 0); + c45: rgb(114.75, 0, 0); + c46: rgb(117.3, 0, 0); + c47: rgb(119.85, 0, 0); + c48: rgb(122.4, 0, 0); + c49: rgb(124.95, 0, 0); + c50: rgb(127.5, 0, 0); + c51: rgb(130.05, 0, 0); + c52: rgb(132.6, 0, 0); + c53: rgb(135.15, 0, 0); + c54: rgb(137.7, 0, 0); + c55: rgb(140.25, 0, 0); + c56: rgb(142.8, 0, 0); + c57: rgb(145.35, 0, 0); + c58: rgb(147.9, 0, 0); + c59: rgb(150.45, 0, 0); c60: rgb(153, 0, 0); - c61: rgb(156, 0, 0); - c62: rgb(158, 0, 0); - c63: rgb(161, 0, 0); - c64: rgb(163, 0, 0); - c65: rgb(166, 0, 0); - c66: rgb(168, 0, 0); - c67: rgb(171, 0, 0); - c68: rgb(173, 0, 0); - c69: rgb(176, 0, 0); - c70: rgb(179, 0, 0); - c71: rgb(181, 0, 0); - c72: rgb(184, 0, 0); - c73: rgb(186, 0, 0); - c74: rgb(189, 0, 0); - c75: rgb(191, 0, 0); - c76: rgb(194, 0, 0); - c77: rgb(196, 0, 0); - c78: rgb(199, 0, 0); - c79: rgb(201, 0, 0); + c61: rgb(155.55, 0, 0); + c62: rgb(158.1, 0, 0); + c63: rgb(160.65, 0, 0); + c64: rgb(163.2, 0, 0); + c65: rgb(165.75, 0, 0); + c66: rgb(168.3, 0, 0); + c67: rgb(170.85, 0, 0); + c68: rgb(173.4, 0, 0); + c69: rgb(175.95, 0, 0); + c70: rgb(178.5, 0, 0); + c71: rgb(181.05, 0, 0); + c72: rgb(183.6, 0, 0); + c73: rgb(186.15, 0, 0); + c74: rgb(188.7, 0, 0); + c75: rgb(191.25, 0, 0); + c76: rgb(193.8, 0, 0); + c77: rgb(196.35, 0, 0); + c78: rgb(198.9, 0, 0); + c79: rgb(201.45, 0, 0); c80: rgb(204, 0, 0); - c81: rgb(207, 0, 0); - c82: rgb(209, 0, 0); - c83: rgb(212, 0, 0); - c84: rgb(214, 0, 0); - c85: rgb(217, 0, 0); - c86: rgb(219, 0, 0); - c87: rgb(222, 0, 0); - c88: rgb(224, 0, 0); - c89: rgb(227, 0, 0); - c90: rgb(230, 0, 0); - c91: rgb(232, 0, 0); - c92: rgb(235, 0, 0); - c93: rgb(237, 0, 0); - c94: rgb(240, 0, 0); - c95: rgb(242, 0, 0); - c96: rgb(245, 0, 0); - c97: rgb(247, 0, 0); - c98: rgb(250, 0, 0); - c99: rgb(252, 0, 0); + c81: rgb(206.55, 0, 0); + c82: rgb(209.1, 0, 0); + c83: rgb(211.65, 0, 0); + c84: rgb(214.2, 0, 0); + c85: rgb(216.75, 0, 0); + c86: rgb(219.3, 0, 0); + c87: rgb(221.85, 0, 0); + c88: rgb(224.4, 0, 0); + c89: rgb(226.95, 0, 0); + c90: rgb(229.5, 0, 0); + c91: rgb(232.05, 0, 0); + c92: rgb(234.6, 0, 0); + c93: rgb(237.15, 0, 0); + c94: rgb(239.7, 0, 0); + c95: rgb(242.25, 0, 0); + c96: rgb(244.8, 0, 0); + c97: rgb(247.35, 0, 0); + c98: rgb(249.9, 0, 0); + c99: rgb(252.45, 0, 0); c100: rgb(255, 0, 0); c101: rgb(255, 0, 0); } diff --git a/spec/libsass/color-functions/rgb/rgba/b.hrx b/spec/libsass/color-functions/rgb/rgba/b.hrx index 0bc37f614f..2e4508a808 100644 --- a/spec/libsass/color-functions/rgb/rgba/b.hrx +++ b/spec/libsass/color-functions/rgb/rgba/b.hrx @@ -631,105 +631,105 @@ foo { foo { c-1: rgb(0, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(0, 0, 3); - c2: rgb(0, 0, 5); - c3: rgb(0, 0, 8); - c4: rgb(0, 0, 10); - c5: rgb(0, 0, 13); - c6: rgb(0, 0, 15); - c7: rgb(0, 0, 18); - c8: rgb(0, 0, 20); - c9: rgb(0, 0, 23); - c10: rgb(0, 0, 26); - c11: rgb(0, 0, 28); - c12: rgb(0, 0, 31); - c13: rgb(0, 0, 33); - c14: rgb(0, 0, 36); - c15: rgb(0, 0, 38); - c16: rgb(0, 0, 41); - c17: rgb(0, 0, 43); - c18: rgb(0, 0, 46); - c19: rgb(0, 0, 48); + c1: rgb(0, 0, 2.55); + c2: rgb(0, 0, 5.1); + c3: rgb(0, 0, 7.65); + c4: rgb(0, 0, 10.2); + c5: rgb(0, 0, 12.75); + c6: rgb(0, 0, 15.3); + c7: rgb(0, 0, 17.85); + c8: rgb(0, 0, 20.4); + c9: rgb(0, 0, 22.95); + c10: rgb(0, 0, 25.5); + c11: rgb(0, 0, 28.05); + c12: rgb(0, 0, 30.6); + c13: rgb(0, 0, 33.15); + c14: rgb(0, 0, 35.7); + c15: rgb(0, 0, 38.25); + c16: rgb(0, 0, 40.8); + c17: rgb(0, 0, 43.35); + c18: rgb(0, 0, 45.9); + c19: rgb(0, 0, 48.45); c20: rgb(0, 0, 51); - c21: rgb(0, 0, 54); - c22: rgb(0, 0, 56); - c23: rgb(0, 0, 59); - c24: rgb(0, 0, 61); - c25: rgb(0, 0, 64); - c26: rgb(0, 0, 66); - c27: rgb(0, 0, 69); - c28: rgb(0, 0, 71); - c29: rgb(0, 0, 74); - c30: rgb(0, 0, 77); - c31: rgb(0, 0, 79); - c32: rgb(0, 0, 82); - c33: rgb(0, 0, 84); - c34: rgb(0, 0, 87); - c35: rgb(0, 0, 89); - c36: rgb(0, 0, 92); - c37: rgb(0, 0, 94); - c38: rgb(0, 0, 97); - c39: rgb(0, 0, 99); + c21: rgb(0, 0, 53.55); + c22: rgb(0, 0, 56.1); + c23: rgb(0, 0, 58.65); + c24: rgb(0, 0, 61.2); + c25: rgb(0, 0, 63.75); + c26: rgb(0, 0, 66.3); + c27: rgb(0, 0, 68.85); + c28: rgb(0, 0, 71.4); + c29: rgb(0, 0, 73.95); + c30: rgb(0, 0, 76.5); + c31: rgb(0, 0, 79.05); + c32: rgb(0, 0, 81.6); + c33: rgb(0, 0, 84.15); + c34: rgb(0, 0, 86.7); + c35: rgb(0, 0, 89.25); + c36: rgb(0, 0, 91.8); + c37: rgb(0, 0, 94.35); + c38: rgb(0, 0, 96.9); + c39: rgb(0, 0, 99.45); c40: rgb(0, 0, 102); - c41: rgb(0, 0, 105); - c42: rgb(0, 0, 107); - c43: rgb(0, 0, 110); - c44: rgb(0, 0, 112); - c45: rgb(0, 0, 115); - c46: rgb(0, 0, 117); - c47: rgb(0, 0, 120); - c48: rgb(0, 0, 122); - c49: rgb(0, 0, 125); - c50: rgb(0, 0, 128); - c51: rgb(0, 0, 130); - c52: rgb(0, 0, 133); - c53: rgb(0, 0, 135); - c54: rgb(0, 0, 138); - c55: rgb(0, 0, 140); - c56: rgb(0, 0, 143); - c57: rgb(0, 0, 145); - c58: rgb(0, 0, 148); - c59: rgb(0, 0, 150); + c41: rgb(0, 0, 104.55); + c42: rgb(0, 0, 107.1); + c43: rgb(0, 0, 109.65); + c44: rgb(0, 0, 112.2); + c45: rgb(0, 0, 114.75); + c46: rgb(0, 0, 117.3); + c47: rgb(0, 0, 119.85); + c48: rgb(0, 0, 122.4); + c49: rgb(0, 0, 124.95); + c50: rgb(0, 0, 127.5); + c51: rgb(0, 0, 130.05); + c52: rgb(0, 0, 132.6); + c53: rgb(0, 0, 135.15); + c54: rgb(0, 0, 137.7); + c55: rgb(0, 0, 140.25); + c56: rgb(0, 0, 142.8); + c57: rgb(0, 0, 145.35); + c58: rgb(0, 0, 147.9); + c59: rgb(0, 0, 150.45); c60: rgb(0, 0, 153); - c61: rgb(0, 0, 156); - c62: rgb(0, 0, 158); - c63: rgb(0, 0, 161); - c64: rgb(0, 0, 163); - c65: rgb(0, 0, 166); - c66: rgb(0, 0, 168); - c67: rgb(0, 0, 171); - c68: rgb(0, 0, 173); - c69: rgb(0, 0, 176); - c70: rgb(0, 0, 179); - c71: rgb(0, 0, 181); - c72: rgb(0, 0, 184); - c73: rgb(0, 0, 186); - c74: rgb(0, 0, 189); - c75: rgb(0, 0, 191); - c76: rgb(0, 0, 194); - c77: rgb(0, 0, 196); - c78: rgb(0, 0, 199); - c79: rgb(0, 0, 201); + c61: rgb(0, 0, 155.55); + c62: rgb(0, 0, 158.1); + c63: rgb(0, 0, 160.65); + c64: rgb(0, 0, 163.2); + c65: rgb(0, 0, 165.75); + c66: rgb(0, 0, 168.3); + c67: rgb(0, 0, 170.85); + c68: rgb(0, 0, 173.4); + c69: rgb(0, 0, 175.95); + c70: rgb(0, 0, 178.5); + c71: rgb(0, 0, 181.05); + c72: rgb(0, 0, 183.6); + c73: rgb(0, 0, 186.15); + c74: rgb(0, 0, 188.7); + c75: rgb(0, 0, 191.25); + c76: rgb(0, 0, 193.8); + c77: rgb(0, 0, 196.35); + c78: rgb(0, 0, 198.9); + c79: rgb(0, 0, 201.45); c80: rgb(0, 0, 204); - c81: rgb(0, 0, 207); - c82: rgb(0, 0, 209); - c83: rgb(0, 0, 212); - c84: rgb(0, 0, 214); - c85: rgb(0, 0, 217); - c86: rgb(0, 0, 219); - c87: rgb(0, 0, 222); - c88: rgb(0, 0, 224); - c89: rgb(0, 0, 227); - c90: rgb(0, 0, 230); - c91: rgb(0, 0, 232); - c92: rgb(0, 0, 235); - c93: rgb(0, 0, 237); - c94: rgb(0, 0, 240); - c95: rgb(0, 0, 242); - c96: rgb(0, 0, 245); - c97: rgb(0, 0, 247); - c98: rgb(0, 0, 250); - c99: rgb(0, 0, 252); + c81: rgb(0, 0, 206.55); + c82: rgb(0, 0, 209.1); + c83: rgb(0, 0, 211.65); + c84: rgb(0, 0, 214.2); + c85: rgb(0, 0, 216.75); + c86: rgb(0, 0, 219.3); + c87: rgb(0, 0, 221.85); + c88: rgb(0, 0, 224.4); + c89: rgb(0, 0, 226.95); + c90: rgb(0, 0, 229.5); + c91: rgb(0, 0, 232.05); + c92: rgb(0, 0, 234.6); + c93: rgb(0, 0, 237.15); + c94: rgb(0, 0, 239.7); + c95: rgb(0, 0, 242.25); + c96: rgb(0, 0, 244.8); + c97: rgb(0, 0, 247.35); + c98: rgb(0, 0, 249.9); + c99: rgb(0, 0, 252.45); c100: rgb(0, 0, 255); c101: rgb(0, 0, 255); } diff --git a/spec/libsass/color-functions/rgb/rgba/g.hrx b/spec/libsass/color-functions/rgb/rgba/g.hrx index 1caa8f0131..2036c80914 100644 --- a/spec/libsass/color-functions/rgb/rgba/g.hrx +++ b/spec/libsass/color-functions/rgb/rgba/g.hrx @@ -631,105 +631,105 @@ foo { foo { c-1: rgb(0, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(0, 3, 0); - c2: rgb(0, 5, 0); - c3: rgb(0, 8, 0); - c4: rgb(0, 10, 0); - c5: rgb(0, 13, 0); - c6: rgb(0, 15, 0); - c7: rgb(0, 18, 0); - c8: rgb(0, 20, 0); - c9: rgb(0, 23, 0); - c10: rgb(0, 26, 0); - c11: rgb(0, 28, 0); - c12: rgb(0, 31, 0); - c13: rgb(0, 33, 0); - c14: rgb(0, 36, 0); - c15: rgb(0, 38, 0); - c16: rgb(0, 41, 0); - c17: rgb(0, 43, 0); - c18: rgb(0, 46, 0); - c19: rgb(0, 48, 0); + c1: rgb(0, 2.55, 0); + c2: rgb(0, 5.1, 0); + c3: rgb(0, 7.65, 0); + c4: rgb(0, 10.2, 0); + c5: rgb(0, 12.75, 0); + c6: rgb(0, 15.3, 0); + c7: rgb(0, 17.85, 0); + c8: rgb(0, 20.4, 0); + c9: rgb(0, 22.95, 0); + c10: rgb(0, 25.5, 0); + c11: rgb(0, 28.05, 0); + c12: rgb(0, 30.6, 0); + c13: rgb(0, 33.15, 0); + c14: rgb(0, 35.7, 0); + c15: rgb(0, 38.25, 0); + c16: rgb(0, 40.8, 0); + c17: rgb(0, 43.35, 0); + c18: rgb(0, 45.9, 0); + c19: rgb(0, 48.45, 0); c20: rgb(0, 51, 0); - c21: rgb(0, 54, 0); - c22: rgb(0, 56, 0); - c23: rgb(0, 59, 0); - c24: rgb(0, 61, 0); - c25: rgb(0, 64, 0); - c26: rgb(0, 66, 0); - c27: rgb(0, 69, 0); - c28: rgb(0, 71, 0); - c29: rgb(0, 74, 0); - c30: rgb(0, 77, 0); - c31: rgb(0, 79, 0); - c32: rgb(0, 82, 0); - c33: rgb(0, 84, 0); - c34: rgb(0, 87, 0); - c35: rgb(0, 89, 0); - c36: rgb(0, 92, 0); - c37: rgb(0, 94, 0); - c38: rgb(0, 97, 0); - c39: rgb(0, 99, 0); + c21: rgb(0, 53.55, 0); + c22: rgb(0, 56.1, 0); + c23: rgb(0, 58.65, 0); + c24: rgb(0, 61.2, 0); + c25: rgb(0, 63.75, 0); + c26: rgb(0, 66.3, 0); + c27: rgb(0, 68.85, 0); + c28: rgb(0, 71.4, 0); + c29: rgb(0, 73.95, 0); + c30: rgb(0, 76.5, 0); + c31: rgb(0, 79.05, 0); + c32: rgb(0, 81.6, 0); + c33: rgb(0, 84.15, 0); + c34: rgb(0, 86.7, 0); + c35: rgb(0, 89.25, 0); + c36: rgb(0, 91.8, 0); + c37: rgb(0, 94.35, 0); + c38: rgb(0, 96.9, 0); + c39: rgb(0, 99.45, 0); c40: rgb(0, 102, 0); - c41: rgb(0, 105, 0); - c42: rgb(0, 107, 0); - c43: rgb(0, 110, 0); - c44: rgb(0, 112, 0); - c45: rgb(0, 115, 0); - c46: rgb(0, 117, 0); - c47: rgb(0, 120, 0); - c48: rgb(0, 122, 0); - c49: rgb(0, 125, 0); - c50: rgb(0, 128, 0); - c51: rgb(0, 130, 0); - c52: rgb(0, 133, 0); - c53: rgb(0, 135, 0); - c54: rgb(0, 138, 0); - c55: rgb(0, 140, 0); - c56: rgb(0, 143, 0); - c57: rgb(0, 145, 0); - c58: rgb(0, 148, 0); - c59: rgb(0, 150, 0); + c41: rgb(0, 104.55, 0); + c42: rgb(0, 107.1, 0); + c43: rgb(0, 109.65, 0); + c44: rgb(0, 112.2, 0); + c45: rgb(0, 114.75, 0); + c46: rgb(0, 117.3, 0); + c47: rgb(0, 119.85, 0); + c48: rgb(0, 122.4, 0); + c49: rgb(0, 124.95, 0); + c50: rgb(0, 127.5, 0); + c51: rgb(0, 130.05, 0); + c52: rgb(0, 132.6, 0); + c53: rgb(0, 135.15, 0); + c54: rgb(0, 137.7, 0); + c55: rgb(0, 140.25, 0); + c56: rgb(0, 142.8, 0); + c57: rgb(0, 145.35, 0); + c58: rgb(0, 147.9, 0); + c59: rgb(0, 150.45, 0); c60: rgb(0, 153, 0); - c61: rgb(0, 156, 0); - c62: rgb(0, 158, 0); - c63: rgb(0, 161, 0); - c64: rgb(0, 163, 0); - c65: rgb(0, 166, 0); - c66: rgb(0, 168, 0); - c67: rgb(0, 171, 0); - c68: rgb(0, 173, 0); - c69: rgb(0, 176, 0); - c70: rgb(0, 179, 0); - c71: rgb(0, 181, 0); - c72: rgb(0, 184, 0); - c73: rgb(0, 186, 0); - c74: rgb(0, 189, 0); - c75: rgb(0, 191, 0); - c76: rgb(0, 194, 0); - c77: rgb(0, 196, 0); - c78: rgb(0, 199, 0); - c79: rgb(0, 201, 0); + c61: rgb(0, 155.55, 0); + c62: rgb(0, 158.1, 0); + c63: rgb(0, 160.65, 0); + c64: rgb(0, 163.2, 0); + c65: rgb(0, 165.75, 0); + c66: rgb(0, 168.3, 0); + c67: rgb(0, 170.85, 0); + c68: rgb(0, 173.4, 0); + c69: rgb(0, 175.95, 0); + c70: rgb(0, 178.5, 0); + c71: rgb(0, 181.05, 0); + c72: rgb(0, 183.6, 0); + c73: rgb(0, 186.15, 0); + c74: rgb(0, 188.7, 0); + c75: rgb(0, 191.25, 0); + c76: rgb(0, 193.8, 0); + c77: rgb(0, 196.35, 0); + c78: rgb(0, 198.9, 0); + c79: rgb(0, 201.45, 0); c80: rgb(0, 204, 0); - c81: rgb(0, 207, 0); - c82: rgb(0, 209, 0); - c83: rgb(0, 212, 0); - c84: rgb(0, 214, 0); - c85: rgb(0, 217, 0); - c86: rgb(0, 219, 0); - c87: rgb(0, 222, 0); - c88: rgb(0, 224, 0); - c89: rgb(0, 227, 0); - c90: rgb(0, 230, 0); - c91: rgb(0, 232, 0); - c92: rgb(0, 235, 0); - c93: rgb(0, 237, 0); - c94: rgb(0, 240, 0); - c95: rgb(0, 242, 0); - c96: rgb(0, 245, 0); - c97: rgb(0, 247, 0); - c98: rgb(0, 250, 0); - c99: rgb(0, 252, 0); + c81: rgb(0, 206.55, 0); + c82: rgb(0, 209.1, 0); + c83: rgb(0, 211.65, 0); + c84: rgb(0, 214.2, 0); + c85: rgb(0, 216.75, 0); + c86: rgb(0, 219.3, 0); + c87: rgb(0, 221.85, 0); + c88: rgb(0, 224.4, 0); + c89: rgb(0, 226.95, 0); + c90: rgb(0, 229.5, 0); + c91: rgb(0, 232.05, 0); + c92: rgb(0, 234.6, 0); + c93: rgb(0, 237.15, 0); + c94: rgb(0, 239.7, 0); + c95: rgb(0, 242.25, 0); + c96: rgb(0, 244.8, 0); + c97: rgb(0, 247.35, 0); + c98: rgb(0, 249.9, 0); + c99: rgb(0, 252.45, 0); c100: rgb(0, 255, 0); c101: rgb(0, 255, 0); } diff --git a/spec/libsass/color-functions/rgb/rgba/r.hrx b/spec/libsass/color-functions/rgb/rgba/r.hrx index d7f9dd3894..305608c65d 100644 --- a/spec/libsass/color-functions/rgb/rgba/r.hrx +++ b/spec/libsass/color-functions/rgb/rgba/r.hrx @@ -631,105 +631,105 @@ foo { foo { c-1: rgb(0, 0, 0); c0: rgb(0, 0, 0); - c1: rgb(3, 0, 0); - c2: rgb(5, 0, 0); - c3: rgb(8, 0, 0); - c4: rgb(10, 0, 0); - c5: rgb(13, 0, 0); - c6: rgb(15, 0, 0); - c7: rgb(18, 0, 0); - c8: rgb(20, 0, 0); - c9: rgb(23, 0, 0); - c10: rgb(26, 0, 0); - c11: rgb(28, 0, 0); - c12: rgb(31, 0, 0); - c13: rgb(33, 0, 0); - c14: rgb(36, 0, 0); - c15: rgb(38, 0, 0); - c16: rgb(41, 0, 0); - c17: rgb(43, 0, 0); - c18: rgb(46, 0, 0); - c19: rgb(48, 0, 0); + c1: rgb(2.55, 0, 0); + c2: rgb(5.1, 0, 0); + c3: rgb(7.65, 0, 0); + c4: rgb(10.2, 0, 0); + c5: rgb(12.75, 0, 0); + c6: rgb(15.3, 0, 0); + c7: rgb(17.85, 0, 0); + c8: rgb(20.4, 0, 0); + c9: rgb(22.95, 0, 0); + c10: rgb(25.5, 0, 0); + c11: rgb(28.05, 0, 0); + c12: rgb(30.6, 0, 0); + c13: rgb(33.15, 0, 0); + c14: rgb(35.7, 0, 0); + c15: rgb(38.25, 0, 0); + c16: rgb(40.8, 0, 0); + c17: rgb(43.35, 0, 0); + c18: rgb(45.9, 0, 0); + c19: rgb(48.45, 0, 0); c20: rgb(51, 0, 0); - c21: rgb(54, 0, 0); - c22: rgb(56, 0, 0); - c23: rgb(59, 0, 0); - c24: rgb(61, 0, 0); - c25: rgb(64, 0, 0); - c26: rgb(66, 0, 0); - c27: rgb(69, 0, 0); - c28: rgb(71, 0, 0); - c29: rgb(74, 0, 0); - c30: rgb(77, 0, 0); - c31: rgb(79, 0, 0); - c32: rgb(82, 0, 0); - c33: rgb(84, 0, 0); - c34: rgb(87, 0, 0); - c35: rgb(89, 0, 0); - c36: rgb(92, 0, 0); - c37: rgb(94, 0, 0); - c38: rgb(97, 0, 0); - c39: rgb(99, 0, 0); + c21: rgb(53.55, 0, 0); + c22: rgb(56.1, 0, 0); + c23: rgb(58.65, 0, 0); + c24: rgb(61.2, 0, 0); + c25: rgb(63.75, 0, 0); + c26: rgb(66.3, 0, 0); + c27: rgb(68.85, 0, 0); + c28: rgb(71.4, 0, 0); + c29: rgb(73.95, 0, 0); + c30: rgb(76.5, 0, 0); + c31: rgb(79.05, 0, 0); + c32: rgb(81.6, 0, 0); + c33: rgb(84.15, 0, 0); + c34: rgb(86.7, 0, 0); + c35: rgb(89.25, 0, 0); + c36: rgb(91.8, 0, 0); + c37: rgb(94.35, 0, 0); + c38: rgb(96.9, 0, 0); + c39: rgb(99.45, 0, 0); c40: rgb(102, 0, 0); - c41: rgb(105, 0, 0); - c42: rgb(107, 0, 0); - c43: rgb(110, 0, 0); - c44: rgb(112, 0, 0); - c45: rgb(115, 0, 0); - c46: rgb(117, 0, 0); - c47: rgb(120, 0, 0); - c48: rgb(122, 0, 0); - c49: rgb(125, 0, 0); - c50: rgb(128, 0, 0); - c51: rgb(130, 0, 0); - c52: rgb(133, 0, 0); - c53: rgb(135, 0, 0); - c54: rgb(138, 0, 0); - c55: rgb(140, 0, 0); - c56: rgb(143, 0, 0); - c57: rgb(145, 0, 0); - c58: rgb(148, 0, 0); - c59: rgb(150, 0, 0); + c41: rgb(104.55, 0, 0); + c42: rgb(107.1, 0, 0); + c43: rgb(109.65, 0, 0); + c44: rgb(112.2, 0, 0); + c45: rgb(114.75, 0, 0); + c46: rgb(117.3, 0, 0); + c47: rgb(119.85, 0, 0); + c48: rgb(122.4, 0, 0); + c49: rgb(124.95, 0, 0); + c50: rgb(127.5, 0, 0); + c51: rgb(130.05, 0, 0); + c52: rgb(132.6, 0, 0); + c53: rgb(135.15, 0, 0); + c54: rgb(137.7, 0, 0); + c55: rgb(140.25, 0, 0); + c56: rgb(142.8, 0, 0); + c57: rgb(145.35, 0, 0); + c58: rgb(147.9, 0, 0); + c59: rgb(150.45, 0, 0); c60: rgb(153, 0, 0); - c61: rgb(156, 0, 0); - c62: rgb(158, 0, 0); - c63: rgb(161, 0, 0); - c64: rgb(163, 0, 0); - c65: rgb(166, 0, 0); - c66: rgb(168, 0, 0); - c67: rgb(171, 0, 0); - c68: rgb(173, 0, 0); - c69: rgb(176, 0, 0); - c70: rgb(179, 0, 0); - c71: rgb(181, 0, 0); - c72: rgb(184, 0, 0); - c73: rgb(186, 0, 0); - c74: rgb(189, 0, 0); - c75: rgb(191, 0, 0); - c76: rgb(194, 0, 0); - c77: rgb(196, 0, 0); - c78: rgb(199, 0, 0); - c79: rgb(201, 0, 0); + c61: rgb(155.55, 0, 0); + c62: rgb(158.1, 0, 0); + c63: rgb(160.65, 0, 0); + c64: rgb(163.2, 0, 0); + c65: rgb(165.75, 0, 0); + c66: rgb(168.3, 0, 0); + c67: rgb(170.85, 0, 0); + c68: rgb(173.4, 0, 0); + c69: rgb(175.95, 0, 0); + c70: rgb(178.5, 0, 0); + c71: rgb(181.05, 0, 0); + c72: rgb(183.6, 0, 0); + c73: rgb(186.15, 0, 0); + c74: rgb(188.7, 0, 0); + c75: rgb(191.25, 0, 0); + c76: rgb(193.8, 0, 0); + c77: rgb(196.35, 0, 0); + c78: rgb(198.9, 0, 0); + c79: rgb(201.45, 0, 0); c80: rgb(204, 0, 0); - c81: rgb(207, 0, 0); - c82: rgb(209, 0, 0); - c83: rgb(212, 0, 0); - c84: rgb(214, 0, 0); - c85: rgb(217, 0, 0); - c86: rgb(219, 0, 0); - c87: rgb(222, 0, 0); - c88: rgb(224, 0, 0); - c89: rgb(227, 0, 0); - c90: rgb(230, 0, 0); - c91: rgb(232, 0, 0); - c92: rgb(235, 0, 0); - c93: rgb(237, 0, 0); - c94: rgb(240, 0, 0); - c95: rgb(242, 0, 0); - c96: rgb(245, 0, 0); - c97: rgb(247, 0, 0); - c98: rgb(250, 0, 0); - c99: rgb(252, 0, 0); + c81: rgb(206.55, 0, 0); + c82: rgb(209.1, 0, 0); + c83: rgb(211.65, 0, 0); + c84: rgb(214.2, 0, 0); + c85: rgb(216.75, 0, 0); + c86: rgb(219.3, 0, 0); + c87: rgb(221.85, 0, 0); + c88: rgb(224.4, 0, 0); + c89: rgb(226.95, 0, 0); + c90: rgb(229.5, 0, 0); + c91: rgb(232.05, 0, 0); + c92: rgb(234.6, 0, 0); + c93: rgb(237.15, 0, 0); + c94: rgb(239.7, 0, 0); + c95: rgb(242.25, 0, 0); + c96: rgb(244.8, 0, 0); + c97: rgb(247.35, 0, 0); + c98: rgb(249.9, 0, 0); + c99: rgb(252.45, 0, 0); c100: rgb(255, 0, 0); c101: rgb(255, 0, 0); } diff --git a/spec/libsass/color-functions/saturate.hrx b/spec/libsass/color-functions/saturate.hrx index 0cb809f77f..d16a1238b9 100644 --- a/spec/libsass/color-functions/saturate.hrx +++ b/spec/libsass/color-functions/saturate.hrx @@ -106,103 +106,103 @@ foo { <===> output.css foo { - c0: gray; - c1: #7f817e; - c2: #7f827d; - c3: #7e837c; - c4: #7e857a; - c5: #7d8679; - c6: #7d8778; - c7: #7d8877; - c8: #7c8a75; - c9: #7c8b74; - c10: #7b8c73; - c11: #7b8e71; - c12: #7a8f70; - c13: #7a906f; - c14: #7a916e; - c15: #79936c; - c16: #79946b; - c17: #78956a; - c18: #789669; - c19: #779867; - c20: #779966; - c21: #779a65; - c22: #769c63; - c23: #769d62; - c24: #759e61; - c25: #759f60; - c26: #74a15e; - c27: #74a25d; - c28: #74a35c; - c29: #73a45b; - c30: #73a659; - c31: #72a758; - c32: #72a857; - c33: #71aa55; - c34: #71ab54; - c35: #71ac53; - c36: #70ad52; - c37: #70af50; - c38: #6fb04f; - c39: #6fb14e; - c41: #6eb44b; - c42: #6eb54a; - c43: #6db649; - c44: #6db847; - c45: #6cb946; - c46: #6cba45; - c47: #6cbb44; - c48: #6bbd42; - c49: #6bbe41; - c50: #6abf40; - c51: #6ac13e; - c52: #69c23d; - c53: #69c33c; - c54: #69c43b; - c55: #68c639; - c56: #68c738; - c57: #67c837; - c58: #67c936; - c59: #66cb34; - c60: #66cc33; - c61: #66cd32; - c62: #65cf30; - c63: #65d02f; - c64: #64d12e; - c65: #64d22d; - c66: #63d42b; - c67: #63d52a; - c68: #63d629; - c69: #62d728; - c70: #62d926; - c71: #61da25; - c72: #61db24; - c73: #60dd22; - c74: #60de21; - c75: #60df20; - c76: #5fe01f; - c77: #5fe21d; - c78: #5ee31c; - c79: #5ee41b; - c81: #5de718; - c82: #5de817; - c83: #5ce916; - c84: #5ceb14; - c85: #5bec13; - c86: #5bed12; - c87: #5bee11; - c88: #5af00f; - c89: #5af10e; - c90: #59f20d; - c91: #59f40b; - c92: #58f50a; - c93: #58f609; - c94: #58f708; - c95: #57f906; - c96: #57fa05; - c97: #56fb04; - c98: #56fc03; - c99: #55fe01; - c100: #55ff00; + c0: hsl(100, 0%, 50%); + c1: hsl(100, 1%, 50%); + c2: hsl(100, 2%, 50%); + c3: hsl(100, 3%, 50%); + c4: hsl(100, 4%, 50%); + c5: hsl(100, 5%, 50%); + c6: hsl(100, 6%, 50%); + c7: hsl(100, 7%, 50%); + c8: hsl(100, 8%, 50%); + c9: hsl(100, 9%, 50%); + c10: hsl(100, 10%, 50%); + c11: hsl(100, 11%, 50%); + c12: hsl(100, 12%, 50%); + c13: hsl(100, 13%, 50%); + c14: hsl(100, 14%, 50%); + c15: hsl(100, 15%, 50%); + c16: hsl(100, 16%, 50%); + c17: hsl(100, 17%, 50%); + c18: hsl(100, 18%, 50%); + c19: hsl(100, 19%, 50%); + c20: hsl(100, 20%, 50%); + c21: hsl(100, 21%, 50%); + c22: hsl(100, 22%, 50%); + c23: hsl(100, 23%, 50%); + c24: hsl(100, 24%, 50%); + c25: hsl(100, 25%, 50%); + c26: hsl(100, 26%, 50%); + c27: hsl(100, 27%, 50%); + c28: hsl(100, 28%, 50%); + c29: hsl(100, 29%, 50%); + c30: hsl(100, 30%, 50%); + c31: hsl(100, 31%, 50%); + c32: hsl(100, 32%, 50%); + c33: hsl(100, 33%, 50%); + c34: hsl(100, 34%, 50%); + c35: hsl(100, 35%, 50%); + c36: hsl(100, 36%, 50%); + c37: hsl(100, 37%, 50%); + c38: hsl(100, 38%, 50%); + c39: hsl(100, 39%, 50%); + c41: hsl(100, 41%, 50%); + c42: hsl(100, 42%, 50%); + c43: hsl(100, 43%, 50%); + c44: hsl(100, 44%, 50%); + c45: hsl(100, 45%, 50%); + c46: hsl(100, 46%, 50%); + c47: hsl(100, 47%, 50%); + c48: hsl(100, 48%, 50%); + c49: hsl(100, 49%, 50%); + c50: hsl(100, 50%, 50%); + c51: hsl(100, 51%, 50%); + c52: hsl(100, 52%, 50%); + c53: hsl(100, 53%, 50%); + c54: hsl(100, 54%, 50%); + c55: hsl(100, 55%, 50%); + c56: hsl(100, 56%, 50%); + c57: hsl(100, 57%, 50%); + c58: hsl(100, 58%, 50%); + c59: hsl(100, 59%, 50%); + c60: hsl(100, 60%, 50%); + c61: hsl(100, 61%, 50%); + c62: hsl(100, 62%, 50%); + c63: hsl(100, 63%, 50%); + c64: hsl(100, 64%, 50%); + c65: hsl(100, 65%, 50%); + c66: hsl(100, 66%, 50%); + c67: hsl(100, 67%, 50%); + c68: hsl(100, 68%, 50%); + c69: hsl(100, 69%, 50%); + c70: hsl(100, 70%, 50%); + c71: hsl(100, 71%, 50%); + c72: hsl(100, 72%, 50%); + c73: hsl(100, 73%, 50%); + c74: hsl(100, 74%, 50%); + c75: hsl(100, 75%, 50%); + c76: hsl(100, 76%, 50%); + c77: hsl(100, 77%, 50%); + c78: hsl(100, 78%, 50%); + c79: hsl(100, 79%, 50%); + c81: hsl(100, 81%, 50%); + c82: hsl(100, 82%, 50%); + c83: hsl(100, 83%, 50%); + c84: hsl(100, 84%, 50%); + c85: hsl(100, 85%, 50%); + c86: hsl(100, 86%, 50%); + c87: hsl(100, 87%, 50%); + c88: hsl(100, 88%, 50%); + c89: hsl(100, 89%, 50%); + c90: hsl(100, 90%, 50%); + c91: hsl(100, 91%, 50%); + c92: hsl(100, 92%, 50%); + c93: hsl(100, 93%, 50%); + c94: hsl(100, 94%, 50%); + c95: hsl(100, 95%, 50%); + c96: hsl(100, 96%, 50%); + c97: hsl(100, 97%, 50%); + c98: hsl(100, 98%, 50%); + c99: hsl(100, 99%, 50%); + c100: hsl(100, 100%, 50%); } diff --git a/spec/libsass/test.hrx b/spec/libsass/test.hrx index 92c50ef91b..3e82b28410 100644 --- a/spec/libsass/test.hrx +++ b/spec/libsass/test.hrx @@ -108,7 +108,7 @@ span { g: #782005; h: hsl(25, 100%, 80%); h: rgba(204, 86, 0, 0.8); - h: rgba(204, 85, 0, 0.8); + h: hsla(25, 100%, 40%, 0.8); i: hsla(25, 100%, 40%, 0.8); foo: url("http://blah/flah/grah"); foo: url(http://foo/bar/buzz.css); diff --git a/spec/non_conformant/basic/22_colors_with_alpha.hrx b/spec/non_conformant/basic/22_colors_with_alpha.hrx index 91d1df1cc6..c7ac9de596 100644 --- a/spec/non_conformant/basic/22_colors_with_alpha.hrx +++ b/spec/non_conformant/basic/22_colors_with_alpha.hrx @@ -35,6 +35,43 @@ div { hoo: 123; moo: 45; poo: 6; - goo: rgba(64, 0, 191, 0.75); + goo: rgba(63.75, 0, 191.25, 0.75); boo: #edcba9; } + +<===> warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +16 | hoo: color.red($x); + | ^^^^^^^^^^^^^ + ' + input.scss 16:8 root stylesheet + +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +17 | moo: color.green($x); + | ^^^^^^^^^^^^^^^ + ' + input.scss 17:8 root stylesheet + +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +18 | poo: color.blue($x); + | ^^^^^^^^^^^^^^ + ' + input.scss 18:8 root stylesheet diff --git a/spec/non_conformant/colors/change-color.hrx b/spec/non_conformant/colors/change-color.hrx index 27371a80d5..536025497d 100644 --- a/spec/non_conformant/colors/change-color.hrx +++ b/spec/non_conformant/colors/change-color.hrx @@ -11,5 +11,5 @@ p { color: #102005; color: rgba(16, 32, 48, 0.325); color: #782005; - color: rgba(204, 85, 0, 0.8); + color: hsla(25, 100%, 40%, 0.8); } diff --git a/spec/non_conformant/errors/fn-change-color-1.hrx b/spec/non_conformant/errors/fn-change-color-1.hrx index c3816b9efa..93661a5629 100644 --- a/spec/non_conformant/errors/fn-change-color-1.hrx +++ b/spec/non_conformant/errors/fn-change-color-1.hrx @@ -4,7 +4,7 @@ foo { test: color.change(red, $red: 0.5, $hue: 0.2); } <===> error -Error: RGB parameters may not be passed along with HSL parameters. +Error: $hue: Color space rgb doesn't have a channel with this name. , 3 | test: color.change(red, $red: 0.5, $hue: 0.2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx b/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx index 364a5651be..639cb072be 100644 --- a/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx +++ b/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx @@ -4,5 +4,5 @@ foo {color: color.adjust(black, $lightness: -10%)} <===> output.css foo { - color: black; + color: hsl(0, 0%, -10%); } diff --git a/spec/non_conformant/scss/alpha.hrx b/spec/non_conformant/scss/alpha.hrx index bf638dc5fa..cba760569c 100644 --- a/spec/non_conformant/scss/alpha.hrx +++ b/spec/non_conformant/scss/alpha.hrx @@ -36,3 +36,40 @@ div { poo: 6; boo: #edcba9; } + +<===> warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +17 | hoo: color.red($x); + | ^^^^^^^^^^^^^ + ' + input.scss 17:8 root stylesheet + +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +18 | moo: color.green($x); + | ^^^^^^^^^^^^^^^ + ' + input.scss 18:8 root stylesheet + +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +19 | poo: color.blue($x); + | ^^^^^^^^^^^^^^ + ' + input.scss 19:8 root stylesheet diff --git a/spec/values/calculation/calc/error/value.hrx b/spec/values/calculation/calc/error/value.hrx index 5eee0e63ba..a36a0b6aa0 100644 --- a/spec/values/calculation/calc/error/value.hrx +++ b/spec/values/calculation/calc/error/value.hrx @@ -60,7 +60,7 @@ $a: 1 2 3; b {c: calc($a)} <===> variable/list/error -Error: Value 1 2 3 can't be used in a calculation. +Error: Value (1 2 3) can't be used in a calculation. , 2 | b {c: calc($a)} | ^^ @@ -159,7 +159,7 @@ Error: Value get-function("get-function") can't be used in a calculation. b {c: calc(a())} <===> function/list/error -Error: Value 1 2 3 can't be used in a calculation. +Error: Value (1 2 3) can't be used in a calculation. , 2 | b {c: calc(a())} | ^^^ diff --git a/spec/values/colors/alpha_hex/initial_digit.hrx b/spec/values/colors/alpha_hex/initial_digit.hrx index 2b4c2aa09c..6e151adf4f 100644 --- a/spec/values/colors/alpha_hex/initial_digit.hrx +++ b/spec/values/colors/alpha_hex/initial_digit.hrx @@ -29,3 +29,76 @@ a { eight-digit-blue: 84; eight-digit-alpha: 0.1960784314; } + +<===> warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +7 | four-digit-red: color.red(#0123); + | ^^^^^^^^^^^^^^^^ + ' + input.scss 7:19 root stylesheet + +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +8 | four-digit-green: color.green(#0123); + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 8:21 root stylesheet + +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +9 | four-digit-blue: color.blue(#0123); + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 9:20 root stylesheet + +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +12 | eight-digit-red: color.red(#98765432); + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 12:20 root stylesheet + +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +13 | eight-digit-green: color.green(#98765432); + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 13:22 root stylesheet + +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +14 | eight-digit-blue: color.blue(#98765432); + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 14:21 root stylesheet diff --git a/spec/values/colors/alpha_hex/initial_letter.hrx b/spec/values/colors/alpha_hex/initial_letter.hrx index fde7d324be..c06184d04e 100644 --- a/spec/values/colors/alpha_hex/initial_letter.hrx +++ b/spec/values/colors/alpha_hex/initial_letter.hrx @@ -29,3 +29,76 @@ a { eight-digit-blue: 239; eight-digit-alpha: 0.0705882353; } + +<===> warning +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +7 | four-digit-red: color.red(#abcd); + | ^^^^^^^^^^^^^^^^ + ' + input.scss 7:19 root stylesheet + +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +8 | four-digit-green: color.green(#abcd); + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 8:21 root stylesheet + +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +9 | four-digit-blue: color.blue(#abcd); + | ^^^^^^^^^^^^^^^^^ + ' + input.scss 9:20 root stylesheet + +DEPRECATION WARNING: color.red() is deprecated. Suggestion: + +color.channel($color, red) + +More info: https://sass-lang.com/d/color-functions + + , +12 | eight-digit-red: color.red(#ABCDEF12); + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 12:20 root stylesheet + +DEPRECATION WARNING: color.green() is deprecated. Suggestion: + +color.channel($color, green) + +More info: https://sass-lang.com/d/color-functions + + , +13 | eight-digit-green: color.green(#ABCDEF12); + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 13:22 root stylesheet + +DEPRECATION WARNING: color.blue() is deprecated. Suggestion: + +color.channel($color, blue) + +More info: https://sass-lang.com/d/color-functions + + , +14 | eight-digit-blue: color.blue(#ABCDEF12); + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 14:21 root stylesheet diff --git a/spec/values/colors/equality.hrx b/spec/values/colors/equality.hrx new file mode 100644 index 0000000000..44f1e9b0c7 --- /dev/null +++ b/spec/values/colors/equality.hrx @@ -0,0 +1,251 @@ +<===> true/legacy/same_space/rgb/no_none/input.scss +a {b: #abcdef == #abcdef} + +<===> true/legacy/same_space/rgb/no_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/same_space/rgb/none/input.scss +a {b: rgb(50 none 120) == rgb(50 none 120)} + +<===> true/legacy/same_space/rgb/none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/same_space/hsl/no_none/input.scss +a {b: hsl(250, 80%, 20%) == hsl(250deg, 80%, 20%)} + +<===> true/legacy/same_space/hsl/no_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/same_space/hsl/none/input.scss +a {b: hsl(none 80% 20%) == hsl(none 80% 20%)} + +<===> true/legacy/same_space/hsl/none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/same_space/hsl/wrapped_hue/input.scss +a {b: hsl(180, 80%, 20%) == hsl(540, 80%, 20%)} + +<===> true/legacy/same_space/hsl/wrapped_hue/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/same_space/hwb/no_none/input.scss +a {b: hwb(250 30% 20%) == hwb(250deg 30% 20%)} + +<===> true/legacy/same_space/hwb/no_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/same_space/hwb/none/input.scss +a {b: hwb(none 30% 20%) == hwb(none 30% 20%)} + +<===> true/legacy/same_space/hwb/none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/different_space/no_none/input.scss +a {b: purple == hsl(300, 100%, 25.098039215686%)} + +<===> true/legacy/different_space/no_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/legacy/different_space/none/input.scss +a {b: gray == hsl(none 0% 50.196078431373%)} + +<===> true/legacy/different_space/none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/no_alpha_or_none/input.scss +a {b: lab(66% 50 -100) == lab(66% 50 -100)} + +<===> true/no_alpha_or_none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/alpha/input.scss +a {b: color(prophoto-rgb 0.3 0.4 0.5 / 0.6) == color(prophoto-rgb 0.3 0.4 0.5 / 0.6)} + +<===> true/alpha/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/none/input.scss +a {b: lch(100% 0% none) == lch(100% 0% none)} + +<===> true/none/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> true/within_epsilon/input.scss +a { + b: oklab( + 50.0000000000001 29.9999999999999 -20.0000000000001 / 0.999999999999 + ) == oklab(50 30 -20); +} + +<===> true/within_epsilon/output.css +a { + b: true; +} + +<===> +================================================================================ +<===> false/different_type/input.scss +a {b: red == unquote("red")} + +<===> false/different_type/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/legacy/same_space/rgb/no_none/input.scss +a {b: red == blue} + +<===> false/legacy/same_space/rgb/no_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/legacy/same_space/rgb/one_none/input.scss +a {b: rgb(0 100 200) == rgb(none 100 200)} + +<===> false/legacy/same_space/rgb/one_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/legacy/same_space/hsl/no_none/input.scss +a {b: hsl(50deg 50% 80%) == hsl(51deg 50% 80%)} + +<===> false/legacy/same_space/hsl/no_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/legacy/same_space/hsl/one_none/input.scss +a {b: hsl(0 0% 80%) == hsl(none 0% 80%)} + +<===> false/legacy/same_space/hsl/one_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/legacy/same_space/hwb/no_none/input.scss +a {b: hwb(50deg 20% 30%) == hwb(51deg 20% 30%)} + +<===> false/legacy/same_space/hwb/no_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/legacy/same_space/hwb/one_none/input.scss +a {b: hwb(0 0% 0%) == hwb(none 0% 0%)} + +<===> false/legacy/same_space/hwb/one_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/legacy/different_space/input.scss +a {b: red == hsl(0, 0%, 50%)} + +<===> false/legacy/different_space/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/same_space/no_none/input.scss +a {b: color(prophoto-rgb 0.1 0.2 0.3) == color(prophoto-rgb 0.1 0.2 0.4)} + +<===> false/same_space/no_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/same_space/one_none/input.scss +a {b: oklch(50% 0% none) == oklch(50% 0% 0)} + +<===> false/same_space/one_none/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/same_space/different_alpha/input.scss +a {b: lab(50% 100 -100) == lab(50% 100 -100 / 0.9)} + +<===> false/same_space/different_alpha/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> false/different_space/input.scss +a {b: color(srgb 0 0 0) == color(srgb-linear 0 0 0)} + +<===> false/different_space/output.css +a { + b: false; +} diff --git a/spec/values/identifiers/escape/options.yml b/spec/values/identifiers/escape/options.yml deleted file mode 100644 index 8380261167..0000000000 --- a/spec/values/identifiers/escape/options.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -:todo: -- sass/libsass#2700