Comments (7)
Now that I have this key piece of information, I can make the colors look much more brand-appropriate!
Thanks again!
from sampler.
Hi @bknowles
The colors for both dark and light theme are defined here:
https://github.com/sqshq/sampler/blob/master/console/palette.go
Basically it is a number of predefined colors, which will be set for the lines on the chart, if user did not specify his own colors.
In this example GOOGLE has user-defined color (178), and YAHOO color is taken from the predefined list.
runcharts:
- title: Search engine response time
rate-ms: 500 # sampling rate, default = 1000
scale: 2 # number of digits after sample decimal point, default = 1
legend:
enabled: true # enables item labels, default = true
details: false # enables item statistics: cur/min/max/dlt values, default = true
items:
- label: GOOGLE
sample: curl -o /dev/null -s -w '%{time_total}' https://www.google.com
color: 178 # 8-bit color number, default one is chosen from a pre-defined palette
- label: YAHOO
sample: curl -o /dev/null -s -w '%{time_total}' https://search.yahoo.com
So if you don't like the default ones, you can specify your own color for each of the lines on your chart
from sampler.
@sqshq -- Okay, so if I understand correctly, then according to that table, Google should be shown in "ColorOlive", correct?
I gave this a shot, and the colors seem to be off to me. I also posted a screenshot to imgur at https://imgur.com/RTCRf22, in case I'm not able to attach it here:
To me, that color looks more like yellow, not anything I would recognize as "olive". And I'm also confused as to how those other colors get chosen -- Yahoo is shown in a light blue color, and Bing is shown in a Pinkish color. Is there some lookup table or other formula that I am missing?
from sampler.
I can find plenty of charts of web-safe colors and their specific RGB components or hex codes, but it's not clear to me how I could make the line for Yahoo to reasonably closely match their official corporate Purple color. How do I find out what all the 256 colors are and what indexes map to what RGB values?
from sampler.
Sampler has nothing to do with Google or Yahoo. This is just an abstract example of sampling a search engine response time using the curl command.
If you'd like to change a color of a line - just specify anything in range from 0 to 255. See 8 bit colors cheat sheet
Olive
is the Xterm color name for 178
, that's why it is named like that in the code. Color names are not exposed to the user, so it does not matter anyway
from sampler.
Okay, that cheat sheet is what I was missing!
Can we get that linked into the documentation, or somewhere else?
from sampler.
BTW, here is what my runcharts.yml
now looks like:
runcharts:
- title: Search engine response time
rate-ms: 500 # sampling rate, default = 1000
scale: 2 # number of digits after sample decimal point, default = 1
legend:
enabled: true # enables item labels, default = true
details: false # enables item statistics: cur/min/max/dlt values, default = true
items:
- label: GOOGLE
sample: curl -o /dev/null -s -w '%{time_total}' https://www.google.com
color: 178 # 8-bit color number, default one is chosen from a pre-defined palette
- label: YAHOO
sample: curl -o /dev/null -s -w '%{time_total}' https://search.yahoo.com
color: 91 # See cheat sheet at https://jonasjacek.github.io/colors/
- label: BING
sample: curl -o /dev/null -s -w '%{time_total}' https://www.bing.com
color: 29 # See cheat sheet at https://jonasjacek.github.io/colors/
If you would like me to file a PR for this, please let me know. I'm happy to help.
from sampler.
Related Issues (20)
- Sampler freezes after spawing a lot of processes (on server)
- Feature request: Dynamic items or Dictionnary items
- Variables unavailable in trigger conditions HOT 2
- Why $label rotation in conditions? HOT 3
- Failed to parse a number HOT 1
- Possibility to use deltas between samples
- Macos ssh pty error HOT 8
- Strange behavior on asciiboxes > sample command not well interpreted (bad yaml ?) HOT 1
- :grey_question: Layout question (jq | column) inside textboxes (deal with t ad \t)
- wrong results of sample commands
- Conditional color for textbox
- textbox keeps previous output after getting empty result from jq
- 500th fork!
- Configuration Error Ubuntu 21.10 HOT 1
- how to show two digit number in windows? HOT 1
- Can no longer compile from Source - Missing oto HOT 2
- Vulnerability of dependency "gopkg.in/yaml.v3"
- windows textboxes newline not working
- Paycode
- Cmder: bad link on website HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sampler.