🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5Paper : Usage of canvas.setTextColor() to define different grey scales.

    Arduino
    2
    3
    3.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      zitrone
      last edited by

      Hi,
      I have a basic question arising from lack of examples.

      I am referring to
      https://docs.m5stack.com/en/api/m5paper/epd_canvas
      in order to set different grey scales for text on a canvas.

      I tried values from 0 to 15, 0x00, 0x0F, 0xFF and so on and found only 3 grey shades working.
      Can someone please specify which are the different values to be passed in as the first argument to canvas.setTextColor() in order to achieve the 16 different grey scale variants?

      Thanks,
      Zitrone

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @zitrone

        the number of gray scales depends on the refresh mode used. For instance UPDATE_MODE_DU4 has 4 whereas UPDATE_MODE_GC16 has 16. Check out the description at the beginning of this file.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 1
        • Z
          zitrone
          last edited by

          @felmue Thank you for the explanation and the link :)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post