How to get resulting color of sass filter: saturate() on a specific hex color?
up vote
1
down vote
favorite
Let's say I have the following code:
.foo {
color: #004454;
filter:
saturate(1.50);
}
Is there a way inside ruby to get the resulting color hex value of .foo
?
The ruby saturate methods in https://github.com/halostatue/color don't change this color at all, for example:
Color::RGB.by_hex('004454').adjust_saturation(50).hex
=> "004454"
And since this color is already saturated at 100% I can't expect this to work, case in point:
Color::RGB.by_hex('004454').adjust_saturation(50).to_hsl
=> HSL [191.43 deg, 100.00%, 16.47%]
I guess what I need to do is find away to apply the magic that css filter applies as you can see clearly here in this jsfiddle
css ruby colors sass hex
add a comment |
up vote
1
down vote
favorite
Let's say I have the following code:
.foo {
color: #004454;
filter:
saturate(1.50);
}
Is there a way inside ruby to get the resulting color hex value of .foo
?
The ruby saturate methods in https://github.com/halostatue/color don't change this color at all, for example:
Color::RGB.by_hex('004454').adjust_saturation(50).hex
=> "004454"
And since this color is already saturated at 100% I can't expect this to work, case in point:
Color::RGB.by_hex('004454').adjust_saturation(50).to_hsl
=> HSL [191.43 deg, 100.00%, 16.47%]
I guess what I need to do is find away to apply the magic that css filter applies as you can see clearly here in this jsfiddle
css ruby colors sass hex
1
I don't think there's a way but you could use this gem github.com/halostatue/color and do something likeColor::RGB.by_hex('004454').adjust_saturation(0.5)
– luisenrike
Nov 19 at 16:06
@luisenrike Thanks yeah I had already tried that, it didn't work. See updated question.
– lacostenycoder
Nov 20 at 8:28
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Let's say I have the following code:
.foo {
color: #004454;
filter:
saturate(1.50);
}
Is there a way inside ruby to get the resulting color hex value of .foo
?
The ruby saturate methods in https://github.com/halostatue/color don't change this color at all, for example:
Color::RGB.by_hex('004454').adjust_saturation(50).hex
=> "004454"
And since this color is already saturated at 100% I can't expect this to work, case in point:
Color::RGB.by_hex('004454').adjust_saturation(50).to_hsl
=> HSL [191.43 deg, 100.00%, 16.47%]
I guess what I need to do is find away to apply the magic that css filter applies as you can see clearly here in this jsfiddle
css ruby colors sass hex
Let's say I have the following code:
.foo {
color: #004454;
filter:
saturate(1.50);
}
Is there a way inside ruby to get the resulting color hex value of .foo
?
The ruby saturate methods in https://github.com/halostatue/color don't change this color at all, for example:
Color::RGB.by_hex('004454').adjust_saturation(50).hex
=> "004454"
And since this color is already saturated at 100% I can't expect this to work, case in point:
Color::RGB.by_hex('004454').adjust_saturation(50).to_hsl
=> HSL [191.43 deg, 100.00%, 16.47%]
I guess what I need to do is find away to apply the magic that css filter applies as you can see clearly here in this jsfiddle
css ruby colors sass hex
css ruby colors sass hex
edited Nov 20 at 8:31
asked Nov 19 at 14:22
lacostenycoder
3,56011226
3,56011226
1
I don't think there's a way but you could use this gem github.com/halostatue/color and do something likeColor::RGB.by_hex('004454').adjust_saturation(0.5)
– luisenrike
Nov 19 at 16:06
@luisenrike Thanks yeah I had already tried that, it didn't work. See updated question.
– lacostenycoder
Nov 20 at 8:28
add a comment |
1
I don't think there's a way but you could use this gem github.com/halostatue/color and do something likeColor::RGB.by_hex('004454').adjust_saturation(0.5)
– luisenrike
Nov 19 at 16:06
@luisenrike Thanks yeah I had already tried that, it didn't work. See updated question.
– lacostenycoder
Nov 20 at 8:28
1
1
I don't think there's a way but you could use this gem github.com/halostatue/color and do something like
Color::RGB.by_hex('004454').adjust_saturation(0.5)
– luisenrike
Nov 19 at 16:06
I don't think there's a way but you could use this gem github.com/halostatue/color and do something like
Color::RGB.by_hex('004454').adjust_saturation(0.5)
– luisenrike
Nov 19 at 16:06
@luisenrike Thanks yeah I had already tried that, it didn't work. See updated question.
– lacostenycoder
Nov 20 at 8:28
@luisenrike Thanks yeah I had already tried that, it didn't work. See updated question.
– lacostenycoder
Nov 20 at 8:28
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376646%2fhow-to-get-resulting-color-of-sass-filter-saturate-on-a-specific-hex-color%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I don't think there's a way but you could use this gem github.com/halostatue/color and do something like
Color::RGB.by_hex('004454').adjust_saturation(0.5)
– luisenrike
Nov 19 at 16:06
@luisenrike Thanks yeah I had already tried that, it didn't work. See updated question.
– lacostenycoder
Nov 20 at 8:28