iris icon indicating copy to clipboard operation
iris copied to clipboard

a way to get color classes / gradient

Open simogeo opened this issue 2 weeks ago • 2 comments

Hi @ozdemirburak,

Is Iris able to generate an array of colors (gradient) based on two or several colors as chroma.js does it simply in javascript ?

See sample here : https://gka.github.io/chroma.js/#scale-colors

Thanks for your reply

simogeo avatar Dec 03 '25 15:12 simogeo

Currently, no. This has been requested before (see #50), so it is something I should definitely add.

However, chroma.js offers a lot of functions and I would prefer to keep things simple but still useful, covering the most common use cases.

Therefore, if you can share your use case (for example: "I need N steps between color A and B" or "I need a scale that goes A → B → C"), that would help me design a minimal and useful gradient API.

ozdemirburak avatar Dec 03 '25 18:12 ozdemirburak

Thanks for your quick reply.

Ideally, I would say both :

  • I need N classes between color A and B
  • I need N classes between color A and C with B color as pivot value

simogeo avatar Dec 04 '25 07:12 simogeo

Added this feature with the latest version (4.1.0). Feel free to check it and please report if something is not working as expected.

Thanks a lot.

ozdemirburak avatar Dec 05 '25 13:12 ozdemirburak

Thanks to you. That's perfect and very easy to use !

simogeo avatar Dec 05 '25 15:12 simogeo

Thanks a lot.

ozdemirburak avatar Dec 05 '25 15:12 ozdemirburak