diff --git a/content/posts/mapping-strings-to-rgb-colors/_index.md b/content/posts/mapping-strings-to-rgb-colors/index.md similarity index 77% rename from content/posts/mapping-strings-to-rgb-colors/_index.md rename to content/posts/mapping-strings-to-rgb-colors/index.md index aee218f..6fa8d75 100644 --- a/content/posts/mapping-strings-to-rgb-colors/_index.md +++ b/content/posts/mapping-strings-to-rgb-colors/index.md @@ -20,14 +20,22 @@ showFullContent: false - Generate an RGB or RGBA color code for it in a deterministic way - SHA1 the string - Interpret equally sized chunks of the hash as integers - - Scale those integers into an 8-bit space + - Scale those integers into an 8-bit unsigned space ## The Implementation +### Hashing +{{< highlight go > }} +{{ highlight > }} +### Interpolation +- Not sure if interpolation is the right technical term +- Using generics +{{< highlight go > }} +{{ highlight > }} ## The Results -Below is a sample of the "lorum ipsum" text with each word colored using this algorithm. +Below is a sample of "lorem ipsum" with each word colored using this algorithm.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- +It doesn't look too bad. ## Possible Improvements - Provide HSV or HSL color values