Git Product home page Git Product logo

Comments (6)

KrzysztofMoch avatar KrzysztofMoch commented on July 17, 2024 2

Okay, I will create PR on days

from react-native-image-colors.

watadarkstar avatar watadarkstar commented on July 17, 2024 1

@KrzysztofMoch Yeah my minimal suggestion here is that the error message is improved. Instead of:

Error: Unknown color

It should be:

Error: Unknown fallback color. Do not use shorthand hex e.g. #fff.

This will make debugging easier for future developers. If you can support shorthand that would be even better but not necessarily needed.

Edit: I thought the error was saying it could not detect the color of the image but it was related to the fallback color which took me awhile to realize.

from react-native-image-colors.

watadarkstar avatar watadarkstar commented on July 17, 2024

@KrzysztofMoch I update the bug report. This only happens when the fallback color is set to #000. On iOS this works but on Android this throws an error. See my description for further details.

To answer your question, it happens for all pictures when given the fallback #000. I fixed it when I gave the fallback #000000. For Android you must give a full hex code otherwise this error is thrown.

from react-native-image-colors.

KrzysztofMoch avatar KrzysztofMoch commented on July 17, 2024

Yes In docs for fallback collor

fallback collor: If a color property couldn't be retrieved, it will default to this hex color string (note: do not use shorthand hex. e.g. #fff).

You must to use 6 characters (e.g #000000)

from react-native-image-colors.

KrzysztofMoch avatar KrzysztofMoch commented on July 17, 2024

@osamaqarem should we add support for 3 chars colros on android ?

from react-native-image-colors.

osamaqarem avatar osamaqarem commented on July 17, 2024

@osamaqarem should we add support for 3 chars colros on android ?

If you would like to go for it, that would be nice 👍

Otherwise the report makes a good point, it would be easy for us to detect the length of the fallback string and throw a friendly error.

from react-native-image-colors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.