Giter Site home page Giter Site logo

Comments (7)

bknowles avatar bknowles commented on April 28, 2024 1

Now that I have this key piece of information, I can make the colors look much more brand-appropriate!

Screen Shot 2019-08-01 at 9 17 21 AM

Thanks again!

from sampler.

sqshq avatar sqshq commented on April 28, 2024

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.

bknowles avatar bknowles commented on April 28, 2024

@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:

Screen Shot 2019-07-31 at 4 50 29 PM

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.

bknowles avatar bknowles commented on April 28, 2024

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.

sqshq avatar sqshq commented on April 28, 2024

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.

bknowles avatar bknowles commented on April 28, 2024

Okay, that cheat sheet is what I was missing!

Can we get that linked into the documentation, or somewhere else?

from sampler.

bknowles avatar bknowles commented on April 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.