Codebergdnkl
foot
master
1#include "hsl.h"
3#include <math.h>
5uint32_t
6hsl_to_rgb(int hue, int sat, int lum)
7{
8 double L = lum / 100.0;
9 double S = sat / 100.0;
10 double C = (1. - fabs(2. * L - 1.)) * S;
12 double X = C * (1. - fabs(fmod((double)hue / 60., 2.) - 1.));
13 double m = L - C / 2.;
15 double r, g, b;
16 if (hue >= 0 && hue <= 60) {
17 r = C;
18 g = X;
19 b = 0.;
20 } else if (hue >= 60 && hue <= 120) {
21 r = X;
22 g = C;
23 b = 0.;
24 } else if (hue >= 120 && hue <= 180) {
25 r = 0.;
26 g = C;
27 b = X;
28 } else if (hue >= 180 && hue <= 240) {
29 r = 0.;
30 g = X;
31 b = C;
32 } else if (hue >= 240 && hue <= 300) {
33 r = X;
34 g = 0.;
35 b = C;
36 } else if (hue >= 300 && hue <= 360) {
37 r = C;
38 g = 0.;
39 b = X;
40 } else {
41 r = 0.;
42 g = 0.;
43 b = 0.;
44 }
46 r += m;
47 g += m;
48 b += m;
50 return (
51 (uint8_t)round(r * 255.) << 16 |
52 (uint8_t)round(g * 255.) << 8 |
53 (uint8_t)round(b * 255.) << 0);
54}
Diagnostics5 git calls · 740 ms
CallStatusSizeTime0740 ms
discover200178 B5 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=5 git.response.bytes=178 git.server.agent=git/2.56.1-Linux git.server.object_format=sha1 git.server.caps=agent ls-refs fetch server-option object-format git.server.fetch=shallow wait-for-done filter git.protocol.version=2 git.pkt.frames=9 git.pkt.data=7 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=178 git.pkt.payload.max=35
ls-refs20010 KiB · hit8 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=10322 git.response.cache=HIT git.response.duration_ms=3 git.protocol.version=2 git.pkt.frames=108 git.pkt.data=107 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=10322 git.pkt.payload.max=106 git.ls_refs.count=107 git.ls_refs.head=refs/heads/master
fetchtree:0 · deepen 102009.3 KiB · hit6 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=6 git.response.bytes=9489 git.response.cache=HIT git.response.duration_ms=6 git.fetch.filter=tree:0 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=9489 git.pkt.payload.max=9389 git.sideband.band1.bytes=9389 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=10 git.pack.bytes=9389 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=de930681b6073ba5b599a0f956bfbd114762ad5a git.pack.full=10Open pack map
fetchtree:02003.6 KiB · hit9 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=9 git.response.bytes=3708 git.response.cache=HIT git.response.duration_ms=9 git.fetch.filter=tree:0 git.fetch.wants=96f1228f4004ebd74530c7f0aea264108eff425f git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=3708 git.pkt.payload.max=3681 git.sideband.band1.bytes=3681 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=3681 git.pack.trailer=731a22f61f25bdfdca1691647f2056631bcfdcf1Open pack map
fetch200419 B717 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=714 git.response.bytes=419 git.response.cache=MISS git.response.duration_ms=717 git.fetch.wants=1a8c919edc2eb06eda0c8613e6135290fccbb0f8 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=419 git.pkt.payload.max=392 git.sideband.band1.bytes=392 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://codeberg.org/dnkl/foot
- Ref
- refs/heads/master
- Commit
- c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
- cf-ray
- a5e15f6a6804725b
- Request
- 1e17836a…
- Protocol
- v2 · sha1
- Agent
- git/2.56.1-Linux
- Filter
- advertised
- Fetch
- shallow wait-for-done filter
- Capabilities
- agent ls-refs fetch server-option object-format