Skip to content
This repository was archived by the owner on Nov 14, 2018. It is now read-only.
This repository was archived by the owner on Nov 14, 2018. It is now read-only.

Add support for manipulating a color as HSV #597

Description

@carlosefonseca

I have some code that allows me to modify a ColorInt as an HSV color and returns a ColorInt.

Basically I can do something like this:

textView.textColor = Color.RED.hsv { h += 50; s *= 0.5; v = 0.25 }

I think it fits KTX because it leverages Kotlin to abstract some boring stuff about working with HSV (conversion to and from the FloatArray), and uses existing framework Util methods to do the work.

It's a small thing, I have it in this gist.

What do you think?

Activity

  1. romainguy commented on Jul 17, 2018

    @romainguy
    Contributor

    I like it, it would make even more sense if we also provided .lab and .rgb.

  2. self-assigned this
    on Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions