Documentation

Overview

    Package color implements XEP-0392: Consistent Color Generation v0.4.

    Example
    Output:
    
    

    Index

    Examples

    Constants

    View Source
    const (
    	None uint8 = iota
    	RedGreen
    	Blue
    )

      A list of color vision deficiencies.

      View Source
      const Size = 2

        Size is the length of the hash output.

        Variables

        This section is empty.

        Functions

        func Bytes

        func Bytes(b []byte, luma uint8, cvd uint8) color.YCbCr

          Bytes converts a byte slice to a color.YCbCr.

          For more information see Sum.

          func Hash

          func Hash(cvd uint8) hash.Hash

            Hash returns a new hash.Hash computing the Y'CbCr color. For more information see Sum.

            func String

            func String(s string, luma uint8, cvd uint8) color.YCbCr

              String converts a string to a color.YCbCr.

              For more information see Sum.

              func Sum

              func Sum(data []byte, cvd uint8) [Size]byte

                Sum returns a color in the Y'CbCr colorspace in the form [Cb, Cr] that is consistent for the same inputs.

                If a color vision deficiency constant is provided (other than None), the algorithm attempts to avoid confusable colors.

                Types

                This section is empty.

                Source Files