From eb743ae85b9bc8ea093e0e50b284accb784d79ed Mon Sep 17 00:00:00 2001 From: Isaak Tsalicoglou Date: Fri, 14 Jun 2024 00:44:20 +0300 Subject: [PATCH] prepare for v0.9.0 --- README.md | 30 ++++++++++++++++++++++++++++-- mix.exs | 6 +++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5541c3f..aa9d4cf 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,16 @@ An Elixir library to generate identicons in SVG format, so they can be inlined in HTML. +## Features + +* Github-style square identicon sizes from 4x4 to 10x10. The hashing function is automatically chosen based on the requested size. The foreground color choice is automatic based on the hash. +* Optional (integer) padding. +* Optional background color, manually defined or automatically set as basic or split complementary. +* Transparent background (also on the padding) if no background color specified. +* Optionally non-100% opacity. +* Small SVG file size makes it great for inlining in HTML. +* No external dependencies. + ## Installation The package is [available in Hex](https://hex.pm/packages/identicon_svg) and can be installed by adding `identicon_svg` to your list of dependencies in `mix.exs`: @@ -11,11 +21,25 @@ The package is [available in Hex](https://hex.pm/packages/identicon_svg) and can ```elixir def deps do [ - {:identicon_svg, "~> 0.8.0"} + {:identicon_svg, "~> 0.9.0"} ] end ``` +## Recent changes + +### New since v0.9.0 + +* Setting `padding` to a positive integer sets the padding to the identicon to that value. If `bg_color` is non-nil, it will also be applied to the padding area with the with the default (1.0) or requested `opacity`, which is also applied on the foreground and the background. +* The size of the generated SVG code is greatly reduced. + +### New since v0.8.0 + +Setting `bg_color` to one of the following 3 atom values sets the color of the background squares to the corresponding RGB-complementary color of the automatically-defined foreground color, with the default (1.0) or requested `opacity`: +* `:basic`: the complementary color, i.e. the opposite color of `fg_color` on the color wheel. +* `:split1`: the first adjacent tertiary color of the complement of `fg_color` on the color wheel. +* `:split2`: the second adjacent tertiary color of the complement of `fg_color` on the color wheel. + ## Configuration No configuration required. @@ -26,11 +50,13 @@ The docs can be found at . There's also a [discussion thread on elixirforum.com](https://elixirforum.com/t/identiconsvg-generates-identicons-in-svg-format-so-they-can-be-inlined-in-html/54557/1). -## TODO +## TODO (maybe, one day) - [x] Implement core functionality - [x] Publish on hex.pm - [x] Add background color functionality (split-complementary for automatic color-matching) +- [x] Add padding +- [x] Reduce generated SVG file size - [ ] Implement testing functions - [ ] Set up CI diff --git a/mix.exs b/mix.exs index 8735586..e4cb989 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule IdenticonSvg.MixProject do def project do [ app: :identicon_svg, - version: "0.8.0", + version: "0.9.0", elixir: "~> 1.14", start_permanent: Mix.env() == :prod, description: description(), @@ -27,7 +27,7 @@ defmodule IdenticonSvg.MixProject do defp description do """ - An Elixir library to generate identicons in SVG format, so they can be inlined in HTML. + An Elixir library to generate Github-style identicons in SVG format with a small file size, so that they can be inlined in HTML. """ end @@ -43,7 +43,7 @@ defmodule IdenticonSvg.MixProject do # Run "mix help compile.app" to learn about applications. def application do [ - extra_applications: [:logger] + extra_applications: [] ] end