How to output rgb(n,n,n) ?
See original GitHub issueI am struggling to get this to work as expected:
$color-black = rgb(0,0,0) // #000000
$color-white = rgb(255,255,255) // #FFFFFF
$color-red = rgb(201,37,49); // #c92531
$colors = primary-red $color-red, primary-white $color-white, primary-black $color-black;
generatestuff($c)
for $pair in $c
.color-{$pair[0]}
color: rgb($pair[1])
generatestuff($colors)
The output is:
.color-primary-red {
color: #c92531;
}
.color-primary-white {
color: #fff;
}
.color-primary-black {
color: #000;
}
What I expect/wants/desire…
.color-primary-red {
color: rgb(201,37,49);
}
.color-primary-white {
color: rgb(255,255,255);
}
.color-primary-black {
color: rgb(0,0,0);
}
How can I achieve this if this is not intended behaviour?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
What is the value for colorControl color state?
I'm developing my own device handler and I have an RGB light. So, I get with setColorcommand a {hue:NN.NNN,saturation:NN.
Read more >MediaWall V 4K/UHD Display Processor User's Guide
This guide is for use with the RGB Spectrum MediaWall V 4K/UHD Display Processor. ... where <nnn.nnn.nnn.nnn> is the MediaWall V IP address....
Read more >ToDo list · Issue #1 · jarun/nnn - GitHub
press r to refresh the list; press del/R to delete (recursive) with confirmation; add option to start in disk usage analyzer mode ...
Read more >https://unpkg.com/material-ui@1.0.0-beta.43/styles...
... the output range * @param {number} max The upper boundary of the output range ... @param {string} color - CSS color, i.e....
Read more >How to change the output color of echo in Linux - Stack Overflow
Tip: for memorize it you can first add \[\] and then put your ANSI code between them: \[start-ANSI-code\]; \[end- ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is intended behaviour. The only way you can achieve this is by saving
r, g, b
values as lists and useunquote('rgb(' + join(',', $color) + ')')
:@Panya @srsgores Sorry for bringing up an old issue, encountered the use case again today.
I was trying to interpolate color variables:
From:
To:
And since the
border-bottom-color
color works, why wouldn’t it work in string interpolation. But it struck me, the interpolation is sent straight trough the parser, right?Because this is the desired outcome:
But we get this:
One way is to do this:
But it’s not very readable.
And this does not either work:
Which makes things a bit inconsistent when searching and debugging the code.
Dunno if this is a rant or a real issue, but needed to jot down my thoughts about this…