public static bool IsWhiteText(ColourData text)
        {
            uint textColour = 0x00000000;

            if (text.m_type == ColourType.Indexed)
            {
                textColour = ConvertColourIndex(text.m_colourValue);
            }
            else if (text.m_type == ColourType.RGB)
            {
                textColour = UInt32.Parse(text.m_colourValue, System.Globalization.NumberStyles.HexNumber);
            }
            ColorState cs = new ColorState();
            return cs.IsWhite(textColour);
        }
        public static bool IsWhiteText(ColourData text, ColourData foreground)
        {
            uint textColour = 0x00000000;
            uint foregroundColour = 0xFFFFFF;

            if (text.m_type == ColourType.Indexed)
            {
                textColour = ConvertColourIndex(text.m_colourValue);
            }
            else if (text.m_type == ColourType.RGB)
            {
                textColour = UInt32.Parse(text.m_colourValue, System.Globalization.NumberStyles.HexNumber);
            }

            ColorState cs = new ColorState();
            if (foreground.m_type == ColourType.Indexed)
            {
                foregroundColour = ConvertColourIndex(foreground.m_colourValue);
            }
            else if (foreground.m_type == ColourType.NotSet)
            { 
                return cs.IsWhite(textColour);
            }
            else
                foregroundColour = UInt32.Parse(foreground.m_colourValue, System.Globalization.NumberStyles.HexNumber);

            return cs.IsWhite(textColour) && cs.IsWhite(foregroundColour);
        }
예제 #3
0
 public bool IsWhiteText(ColourData foregroundColour)
 {
     return StyleInfoColor.IsWhiteText(m_colour, foregroundColour);
 }
        public static bool IsRedactedText(ColourData foreground, ColourData background)
        {
            uint foregroundColour = 0xFFFFFF;
            uint backgroundColour = 0xFFFFFF;
            if (foreground.m_type == ColourType.NotSet)
            {
                foregroundColour = 0x00000000;
            }
            else if (foreground.m_type == ColourType.Indexed)
            {
                foregroundColour = ConvertColourIndex(foreground.m_colourValue);
            }
            else
                foregroundColour = UInt32.Parse(foreground.m_colourValue, System.Globalization.NumberStyles.HexNumber);

            if(background.m_type == ColourType.Indexed)
            {
                backgroundColour = ConvertColourIndex(background.m_colourValue);
            }
            else if (background.m_type == ColourType.RGB)
            {
                backgroundColour = UInt32.Parse(background.m_colourValue, System.Globalization.NumberStyles.HexNumber);
            }

            ColorState cs = new ColorState();
            return cs.IsTextInvisible(foregroundColour, backgroundColour);
        }
예제 #5
0
 public void ResolveColour(XmlNodeInformation nodeInfo)
 {
     m_colour = StyleInfoColor.ResolveColour(nodeInfo);
 }