Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color calculators #2

Closed
49 tasks done
babincc opened this issue Apr 7, 2023 · 2 comments
Closed
49 tasks done

Color calculators #2

babincc opened this issue Apr 7, 2023 · 2 comments
Labels
enhanced desired feature Functionality that absolutely should be added to the program (program technically works without it) package: flutter_hue This issue has to do with the "flutter_hue" package

Comments

@babincc
Copy link
Owner

babincc commented Apr 7, 2023

Add color calculators/converters

  • xy to:
    • RGB
    • HSV
    • Hex
    • HSL
    • Flutter Color object
    • int
  • RGB to:
    • xy
    • HSV
    • Hex
    • HSL
    • Flutter Color object
    • int
  • HSV to:
    • xy
    • RGB
    • Hex
    • HSL
    • Flutter Color object
    • int
  • Hex to:
    • xy
    • RGB
    • HSV
    • HSL
    • Flutter Color object
    • int
  • HSL to:
    • xy
    • RGB
    • HSV
    • Hex
    • Flutter Color object
    • int
  • Flutter color object to:
    • xy
    • RGB
    • HSV
    • Hex
    • HSL
    • int
  • int to:
    • xy
    • RGB
    • HSV
    • Hex
    • HSL
    • Flutter Color object
@babincc babincc added enhanced desired feature Functionality that absolutely should be added to the program (program technically works without it) package: flutter_hue This issue has to do with the "flutter_hue" package labels Apr 7, 2023
@babincc
Copy link
Owner Author

babincc commented Apr 17, 2023

Added in 1.1.0 update

@babincc babincc closed this as completed Apr 17, 2023
@babincc
Copy link
Owner Author

babincc commented Apr 19, 2023

Examples:

ColorConverter.xy2rgb(0.5, 0.5); // [255, 222, 0]
ColorConverter.rgb2hsl(255, 0, 0); // [0.0, 1.0, 0.5]
ColorConverter.hsv2hex(0, 1.0 , 1.0); // "ffff0000"
ColorConverter.color2hsv(Color(0xffff0000)); // [0.0, 1.0, 1.0]
ColorConverter.int2rgb(4286611584); // [128, 128, 128]

Also can be used as an extension of Flutter's Color object

Color myColor = Color(0xff8a4888);

myColor.toXy(); // [0.3209554122773742, 0.21993715851681886, 0.1181557673818057]
myColor.toRgb(); // [138, 72, 136]
myColor.toHex(); // "ff8a4888"
myColor.toInt(); // 4287252616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhanced desired feature Functionality that absolutely should be added to the program (program technically works without it) package: flutter_hue This issue has to do with the "flutter_hue" package
Projects
None yet
Development

No branches or pull requests

1 participant