Material

[!IMPORTANT]
🔥 Found this useful? A quick star goes a long way.
[!CAUTION]
This is tool is in beta and expect some unforeseen bugs.
Pure go implementation of Material Color Utilities
Example
package main
import (
"github.com/Nadim147c/material"
"github.com/Nadim147c/material/dynamic"
)
func main() {
file, err := gophar.Open("gophar.jpg")
if err != nil {
panic(err)
}
img, err := jpeg.Decode(file)
if err != nil {
t.Fatalf("failed to decode image: %v", err)
}
colors, err := material.GenerateFromImage(img, dynamic.Expressive, true, 0, dynamic.Phone, dynamic.V2021)
if err != nil {
t.Fatalf("failed to generate colors: %v", err)
}
for key, value := range colors {
t.Log(key, value)
}
}
License
This project is licensed under the Apache License, Version 2.0. It
includes code derived from
Material Color Utilities
by Google LLC, originally licensed under the
Apache License 2.0.
See the NOTICE file for details and third-party attributions.