sass-embedded 1.96.0 → 1.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8cbaf01c769c022c829cd621e6504ed0b0e69b037b7881ab3c3ccab5d416e054
4
- data.tar.gz: 3185ce04edfcaea566b512685f6184d6caebe98d9d5e670f6ff82c633a277364
3
+ metadata.gz: 8b2af7c9d3e823913522ac0562f7c90c6ad24db1df4960c08aeb4167bb745a66
4
+ data.tar.gz: 151af9b31b07a67394b6ca9fd6328288a219659710809c936500dff65aaff891
5
5
  SHA512:
6
- metadata.gz: f0ff0b55b6e8e1b8fb4f012fe85790417dc34da5a4906863f5b8e0bd3efad4a8e0b5c3a09d1baa4c64a699bb45da46aedbd2afdf78740f54107be2bf3a922edd
7
- data.tar.gz: ac2bafaac27b18784faf73d3b9010401fdcf17b200ada3477b7fdf30f858f2fef7eb572581208d20aa7bbffd23aeaf2370680681f5d37ea36ab15ae5aa400ca1
6
+ metadata.gz: 1c944b39b682257937ede795afe695f7a5f75735857bb395aa647f792869e829536bfb0ebf75e71c7c6676ff0570df1999b5cdb140b849eae701bc8d1bc04ce7
7
+ data.tar.gz: e7ea300aa46a0c7030e501f0b4527403f6632b66ca0d84edc08f38c023ade1d371e3b54d8f87bde7c5eac5f3d77fef416b241fd80e3abba6e6719509d4bd4489
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "sass": "file:sass-1.96.0.tgz"
3
+ "sass": "file:sass-1.97.0.tgz"
4
4
  }
5
5
  }
Binary file
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  module Embedded
5
- VERSION = '1.96.0'
5
+ VERSION = '1.97.0'
6
6
  end
7
7
  end
@@ -28,7 +28,7 @@ module Sass
28
28
 
29
29
  def transformation_matrix(dest)
30
30
  case dest
31
- when DISPLAY_P3
31
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
32
32
  Conversions::LINEAR_A98_RGB_TO_LINEAR_DISPLAY_P3
33
33
  when LMS
34
34
  Conversions::LINEAR_A98_RGB_TO_LMS
@@ -16,6 +16,21 @@ module Sass
16
16
  super('display-p3', Utils::RGB_CHANNELS)
17
17
  end
18
18
 
19
+ def convert(dest, red, green, blue, alpha)
20
+ if dest == DISPLAY_P3_LINEAR
21
+ Color.send(
22
+ :for_space_internal,
23
+ dest,
24
+ red.nil? ? nil : to_linear(red),
25
+ green.nil? ? nil : to_linear(green),
26
+ blue.nil? ? nil : to_linear(blue),
27
+ alpha
28
+ )
29
+ else
30
+ convert_linear(dest, red, green, blue, alpha)
31
+ end
32
+ end
33
+
19
34
  def to_linear(channel)
20
35
  Utils.srgb_and_display_p3_to_linear(channel)
21
36
  end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sass
4
+ module Value
5
+ class Color
6
+ module Space
7
+ # @see https://github.com/sass/dart-sass/blob/main/lib/src/value/color/space/display_p3_linear.dart
8
+ class DisplayP3Linear
9
+ include Space
10
+
11
+ def bounded?
12
+ true
13
+ end
14
+
15
+ def initialize
16
+ super('display-p3-linear', Utils::RGB_CHANNELS)
17
+ end
18
+
19
+ def convert(dest, red, green, blue, alpha)
20
+ if dest == DISPLAY_P3
21
+ Color.send(
22
+ :for_space_internal,
23
+ dest,
24
+ red.nil? ? nil : Utils.srgb_and_display_p3_from_linear(red),
25
+ green.nil? ? nil : Utils.srgb_and_display_p3_from_linear(green),
26
+ blue.nil? ? nil : Utils.srgb_and_display_p3_from_linear(blue),
27
+ alpha
28
+ )
29
+ else
30
+ super
31
+ end
32
+ end
33
+
34
+ def to_linear(channel)
35
+ channel
36
+ end
37
+
38
+ def from_linear(channel)
39
+ channel
40
+ end
41
+
42
+ private
43
+
44
+ def transformation_matrix(dest)
45
+ case dest
46
+ when A98_RGB
47
+ Conversions::LINEAR_DISPLAY_P3_TO_LINEAR_A98_RGB
48
+ when LMS
49
+ Conversions::LINEAR_DISPLAY_P3_TO_LMS
50
+ when PROPHOTO_RGB
51
+ Conversions::LINEAR_DISPLAY_P3_TO_LINEAR_PROPHOTO_RGB
52
+ when REC2020
53
+ Conversions::LINEAR_DISPLAY_P3_TO_LINEAR_REC2020
54
+ when RGB, SRGB, SRGB_LINEAR
55
+ Conversions::LINEAR_DISPLAY_P3_TO_LINEAR_SRGB
56
+ when XYZ_D50
57
+ Conversions::LINEAR_DISPLAY_P3_TO_XYZ_D50
58
+ when XYZ_D65
59
+ Conversions::LINEAR_DISPLAY_P3_TO_XYZ_D65
60
+ else
61
+ super
62
+ end
63
+ end
64
+ end
65
+
66
+ private_constant :DisplayP3Linear
67
+
68
+ DISPLAY_P3_LINEAR = DisplayP3Linear.new
69
+ end
70
+ end
71
+ end
72
+ end
@@ -100,7 +100,7 @@ module Sass
100
100
  case dest
101
101
  when A98_RGB
102
102
  Conversions::LMS_TO_LINEAR_A98_RGB
103
- when DISPLAY_P3
103
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
104
104
  Conversions::LMS_TO_LINEAR_DISPLAY_P3
105
105
  when PROPHOTO_RGB
106
106
  Conversions::LMS_TO_LINEAR_PROPHOTO_RGB
@@ -32,7 +32,7 @@ module Sass
32
32
  case dest
33
33
  when A98_RGB
34
34
  Conversions::LINEAR_PROPHOTO_RGB_TO_LINEAR_A98_RGB
35
- when DISPLAY_P3
35
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
36
36
  Conversions::LINEAR_PROPHOTO_RGB_TO_LINEAR_DISPLAY_P3
37
37
  when LMS
38
38
  Conversions::LINEAR_PROPHOTO_RGB_TO_LMS
@@ -42,7 +42,7 @@ module Sass
42
42
  case dest
43
43
  when A98_RGB
44
44
  Conversions::LINEAR_REC2020_TO_LINEAR_A98_RGB
45
- when DISPLAY_P3
45
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
46
46
  Conversions::LINEAR_REC2020_TO_LINEAR_DISPLAY_P3
47
47
  when LMS
48
48
  Conversions::LINEAR_REC2020_TO_LMS
@@ -113,7 +113,7 @@ module Sass
113
113
  case dest
114
114
  when A98_RGB
115
115
  Conversions::LINEAR_SRGB_TO_LINEAR_A98_RGB
116
- when DISPLAY_P3
116
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
117
117
  Conversions::LINEAR_SRGB_TO_LINEAR_DISPLAY_P3
118
118
  when LMS
119
119
  Conversions::LINEAR_SRGB_TO_LMS
@@ -45,7 +45,7 @@ module Sass
45
45
  case dest
46
46
  when A98_RGB
47
47
  Conversions::LINEAR_SRGB_TO_LINEAR_A98_RGB
48
- when DISPLAY_P3
48
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
49
49
  Conversions::LINEAR_SRGB_TO_LINEAR_DISPLAY_P3
50
50
  when PROPHOTO_RGB
51
51
  Conversions::LINEAR_SRGB_TO_LINEAR_PROPHOTO_RGB
@@ -73,7 +73,7 @@ module Sass
73
73
  case dest
74
74
  when A98_RGB
75
75
  Conversions::XYZ_D50_TO_LINEAR_A98_RGB
76
- when DISPLAY_P3
76
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
77
77
  Conversions::XYZ_D50_TO_LINEAR_DISPLAY_P3
78
78
  when LMS
79
79
  Conversions::XYZ_D50_TO_LMS
@@ -30,7 +30,7 @@ module Sass
30
30
  case dest
31
31
  when A98_RGB
32
32
  Conversions::XYZ_D65_TO_LINEAR_A98_RGB
33
- when DISPLAY_P3
33
+ when DISPLAY_P3, DISPLAY_P3_LINEAR
34
34
  Conversions::XYZ_D65_TO_LINEAR_DISPLAY_P3
35
35
  when LMS
36
36
  Conversions::XYZ_D65_TO_LMS
@@ -51,6 +51,8 @@ module Sass
51
51
  SRGB_LINEAR
52
52
  when 'display-p3'
53
53
  DISPLAY_P3
54
+ when 'display-p3-linear'
55
+ DISPLAY_P3_LINEAR
54
56
  when 'a98-rgb'
55
57
  A98_RGB
56
58
  when 'prophoto-rgb'
@@ -182,6 +184,7 @@ end
182
184
  require_relative 'space/utils'
183
185
  require_relative 'space/a98_rgb'
184
186
  require_relative 'space/display_p3'
187
+ require_relative 'space/display_p3_linear'
185
188
  require_relative 'space/hsl'
186
189
  require_relative 'space/hwb'
187
190
  require_relative 'space/lab'
@@ -41,6 +41,7 @@ module Sass
41
41
  # @overload initialize(lightness: nil, chroma: nil, hue: nil, alpha: nil, space: 'oklch')
42
42
  # @overload initialize(red: nil, green: nil, blue: nil, alpha: nil, space: 'a98-rgb')
43
43
  # @overload initialize(red: nil, green: nil, blue: nil, alpha: nil, space: 'display-p3')
44
+ # @overload initialize(red: nil, green: nil, blue: nil, alpha: nil, space: 'display-p3-linear')
44
45
  # @overload initialize(red: nil, green: nil, blue: nil, alpha: nil, space: 'prophoto-rgb')
45
46
  # @overload initialize(red: nil, green: nil, blue: nil, alpha: nil, space: 'rec2020')
46
47
  # @overload initialize(red: nil, green: nil, blue: nil, alpha: nil, space: 'srgb')
@@ -193,6 +194,7 @@ module Sass
193
194
  # @overload change(lightness: nil, chroma: nil, hue: nil, alpha: nil, space: 'oklch')
194
195
  # @overload change(red: nil, green: nil, blue: nil, alpha: nil, space: 'a98-rgb')
195
196
  # @overload change(red: nil, green: nil, blue: nil, alpha: nil, space: 'display-p3')
197
+ # @overload change(red: nil, green: nil, blue: nil, alpha: nil, space: 'display-p3-linear')
196
198
  # @overload change(red: nil, green: nil, blue: nil, alpha: nil, space: 'prophoto-rgb')
197
199
  # @overload change(red: nil, green: nil, blue: nil, alpha: nil, space: 'rec2020')
198
200
  # @overload change(red: nil, green: nil, blue: nil, alpha: nil, space: 'srgb')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.96.0
4
+ version: 1.97.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
@@ -52,7 +52,7 @@ files:
52
52
  - exe/sass
53
53
  - ext/sass/Rakefile
54
54
  - ext/sass/package.json
55
- - ext/sass/sass-1.96.0.tgz
55
+ - ext/sass/sass-1.97.0.tgz
56
56
  - lib/sass-embedded.rb
57
57
  - lib/sass/calculation_value.rb
58
58
  - lib/sass/calculation_value/calculation_operation.rb
@@ -96,6 +96,7 @@ files:
96
96
  - lib/sass/value/color/space.rb
97
97
  - lib/sass/value/color/space/a98_rgb.rb
98
98
  - lib/sass/value/color/space/display_p3.rb
99
+ - lib/sass/value/color/space/display_p3_linear.rb
99
100
  - lib/sass/value/color/space/hsl.rb
100
101
  - lib/sass/value/color/space/hwb.rb
101
102
  - lib/sass/value/color/space/lab.rb
@@ -125,8 +126,8 @@ licenses:
125
126
  - MIT
126
127
  metadata:
127
128
  bug_tracker_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/issues
128
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.96.0
129
- source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.96.0
129
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.97.0
130
+ source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.97.0
130
131
  funding_uri: https://github.com/sponsors/ntkme
131
132
  rubygems_mfa_required: 'true'
132
133
  rdoc_options: []
Binary file