Skip to content

Commit 8381834

Browse files
committed
Pass mutable strings to Chroma
Chroma currently expects all strings to be mutable. Calling this from frozen_string_literal files works fine, but not on ruby 2.7 where things were handled differently. This syntax can be removed when either a) Chroma accepts frozen strings or b) ruby 2.7 support is dropped
1 parent 71d7f4e commit 8381834

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/glug/chroma_extensions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def mix(other, weight = 50)
1313
g = (rgb.g * p + other.rgb.g * (1 - p)).round
1414
b = (rgb.b * p + other.rgb.b * (1 - p)).round
1515

16-
Chroma.paint("rgb(#{r}, #{g}, #{b})")
16+
Chroma.paint(+"rgb(#{r}, #{g}, #{b})")
1717
end
1818
end
1919
end

lib/glug/hsluv_modifiers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def to_hsluv
6666

6767
def from_hsluv(h, s, l) # rubocop:disable Naming/MethodParameterName
6868
rgb_values = Hsluv.rgb_prepare(Hsluv.hsluv_to_rgb(h, s, l))
69-
Chroma.paint("rgb(#{rgb_values[0]}, #{rgb_values[1]}, #{rgb_values[2]})")
69+
Chroma.paint(+"rgb(#{rgb_values[0]}, #{rgb_values[1]}, #{rgb_values[2]})")
7070
end
7171
end
7272
end

0 commit comments

Comments
 (0)