예제 #1
0
파일: Palette.cs 프로젝트: sami1971/Eto
        /// <summary>
        /// Gets the standard 64-color EGA palette
        /// </summary>
        /// <remarks>
        /// To get the standard 16-colors of an EGA palette, use <see cref="FromEGA"/>
        /// </remarks>
        /// <returns></returns>
        public static Palette GetEgaPalette()
        {
            const float mid  = 168f / 255f;
            const float low  = 84f / 255f;
            const float high = 252f / 255f;
            var         pal  = new Palette();

            pal.Add(new Color(0f, 0f, 0f));
            pal.Add(new Color(0f, 0f, mid));
            pal.Add(new Color(0f, mid, 0f));
            pal.Add(new Color(0f, mid, mid));
            pal.Add(new Color(mid, 0f, 0f));
            pal.Add(new Color(mid, 0f, mid));
            pal.Add(new Color(mid, mid, 0f));
            pal.Add(new Color(mid, mid, mid));
            pal.Add(new Color(0f, 0f, low));
            pal.Add(new Color(0f, 0f, high));
            pal.Add(new Color(0f, mid, low));
            pal.Add(new Color(0f, mid, high));
            pal.Add(new Color(mid, 0f, low));
            pal.Add(new Color(mid, 0f, high));
            pal.Add(new Color(mid, mid, low));
            pal.Add(new Color(mid, mid, high));
            pal.Add(new Color(0f, low, 0f));
            pal.Add(new Color(0f, low, mid));
            pal.Add(new Color(0f, high, 0f));
            pal.Add(new Color(0f, high, mid));
            pal.Add(new Color(mid, low, 0f));
            pal.Add(new Color(mid, low, mid));
            pal.Add(new Color(mid, high, 0f));
            pal.Add(new Color(mid, high, mid));
            pal.Add(new Color(0f, low, low));
            pal.Add(new Color(0f, low, high));
            pal.Add(new Color(0f, high, low));
            pal.Add(new Color(0f, high, high));
            pal.Add(new Color(mid, low, low));
            pal.Add(new Color(mid, low, high));
            pal.Add(new Color(mid, high, low));
            pal.Add(new Color(mid, high, high));
            pal.Add(new Color(low, 0f, 0f));
            pal.Add(new Color(low, 0f, mid));
            pal.Add(new Color(low, mid, 0f));
            pal.Add(new Color(low, mid, mid));
            pal.Add(new Color(high, 0f, 0f));
            pal.Add(new Color(high, 0f, mid));
            pal.Add(new Color(high, mid, 0f));
            pal.Add(new Color(high, mid, mid));
            pal.Add(new Color(low, 0f, low));
            pal.Add(new Color(low, 0f, high));
            pal.Add(new Color(low, mid, low));
            pal.Add(new Color(low, mid, high));
            pal.Add(new Color(high, 0f, low));
            pal.Add(new Color(high, 0f, high));
            pal.Add(new Color(high, mid, low));
            pal.Add(new Color(high, mid, high));
            pal.Add(new Color(low, low, 0f));
            pal.Add(new Color(low, low, mid));
            pal.Add(new Color(low, high, 0f));
            pal.Add(new Color(low, high, mid));
            pal.Add(new Color(high, low, 0f));
            pal.Add(new Color(high, low, mid));
            pal.Add(new Color(high, high, 0f));
            pal.Add(new Color(high, high, mid));
            pal.Add(new Color(low, low, low));
            pal.Add(new Color(low, low, high));
            pal.Add(new Color(low, high, low));
            pal.Add(new Color(low, high, high));
            pal.Add(new Color(high, low, low));
            pal.Add(new Color(high, low, high));
            pal.Add(new Color(high, high, low));
            pal.Add(new Color(high, high, high));
            return(pal);
        }
예제 #2
0
        /// <summary>
        /// Gets the standard 64-color EGA palette
        /// </summary>
        /// <remarks>
        /// To get the standard 16-colors of an EGA palette, use <see cref="FromEGA"/>
        /// </remarks>
        /// <returns></returns>
        public static Palette GetEgaPalette()
        {
            var     mid  = 168f / 255f;
            var     low  = 84f / 255f;
            var     high = 252f / 255f;
            Palette pal  = new Palette();

            pal.Add(new Color(0, 0, 0));
            pal.Add(new Color(0, 0, mid));
            pal.Add(new Color(0, mid, 0));
            pal.Add(new Color(0, mid, mid));
            pal.Add(new Color(mid, 0, 0));
            pal.Add(new Color(mid, 0, mid));
            pal.Add(new Color(mid, mid, 0));
            pal.Add(new Color(mid, mid, mid));
            pal.Add(new Color(0, 0, low));
            pal.Add(new Color(0, 0, high));
            pal.Add(new Color(0, mid, low));
            pal.Add(new Color(0, mid, high));
            pal.Add(new Color(mid, 0, low));
            pal.Add(new Color(mid, 0, high));
            pal.Add(new Color(mid, mid, low));
            pal.Add(new Color(mid, mid, high));
            pal.Add(new Color(0, low, 0));
            pal.Add(new Color(0, low, mid));
            pal.Add(new Color(0, high, 0));
            pal.Add(new Color(0, high, mid));
            pal.Add(new Color(mid, low, 0));
            pal.Add(new Color(mid, low, mid));
            pal.Add(new Color(mid, high, 0));
            pal.Add(new Color(mid, high, mid));
            pal.Add(new Color(0, low, low));
            pal.Add(new Color(0, low, high));
            pal.Add(new Color(0, high, low));
            pal.Add(new Color(0, high, high));
            pal.Add(new Color(mid, low, low));
            pal.Add(new Color(mid, low, high));
            pal.Add(new Color(mid, high, low));
            pal.Add(new Color(mid, high, high));
            pal.Add(new Color(low, 0, 0));
            pal.Add(new Color(low, 0, mid));
            pal.Add(new Color(low, mid, 0));
            pal.Add(new Color(low, mid, mid));
            pal.Add(new Color(high, 0, 0));
            pal.Add(new Color(high, 0, mid));
            pal.Add(new Color(high, mid, 0));
            pal.Add(new Color(high, mid, mid));
            pal.Add(new Color(low, 0, low));
            pal.Add(new Color(low, 0, high));
            pal.Add(new Color(low, mid, low));
            pal.Add(new Color(low, mid, high));
            pal.Add(new Color(high, 0, low));
            pal.Add(new Color(high, 0, high));
            pal.Add(new Color(high, mid, low));
            pal.Add(new Color(high, mid, high));
            pal.Add(new Color(low, low, 0));
            pal.Add(new Color(low, low, mid));
            pal.Add(new Color(low, high, 0));
            pal.Add(new Color(low, high, mid));
            pal.Add(new Color(high, low, 0));
            pal.Add(new Color(high, low, mid));
            pal.Add(new Color(high, high, 0));
            pal.Add(new Color(high, high, mid));
            pal.Add(new Color(low, low, low));
            pal.Add(new Color(low, low, high));
            pal.Add(new Color(low, high, low));
            pal.Add(new Color(low, high, high));
            pal.Add(new Color(high, low, low));
            pal.Add(new Color(high, low, high));
            pal.Add(new Color(high, high, low));
            pal.Add(new Color(high, high, high));
            return(pal);
        }